[gnome-software/wip/rancell/snapd-glib: 5/6] Merge branch 'master' into wip/rancell/snapd-glib



commit e58a83471f55494c1f6e755a0bb15f8d0deace5e
Merge: b86d679 21808f1
Author: Robert Ancell <robert ancell canonical com>
Date:   Thu Feb 2 15:21:21 2017 +1300

    Merge branch 'master' into wip/rancell/snapd-glib

 src/gnome-software-local-file.desktop.in |    2 +-
 src/gs-application.c                     |   49 ++++++++++++++++--------------
 src/gs-shell-details.c                   |    4 ++-
 src/org.gnome.Software.desktop.in        |    2 +-
 src/plugins/gs-plugin-snap.c             |    8 +++--
 5 files changed, 36 insertions(+), 29 deletions(-)
---
diff --cc src/plugins/gs-plugin-snap.c
index d7ccb8d,101a6f5..03c517a
--- a/src/plugins/gs-plugin-snap.c
+++ b/src/plugins/gs-plugin-snap.c
@@@ -263,9 -266,8 +263,8 @@@ gs_plugin_add_installed (GsPlugin *plug
                gs_app_set_scope (app, AS_APP_SCOPE_SYSTEM);
                gs_app_set_bundle_kind (app, AS_BUNDLE_KIND_SNAP);
                gs_app_set_management_plugin (app, "snap");
-               gs_app_set_kind (app, AS_APP_KIND_DESKTOP);
                gs_app_add_quirk (app, AS_APP_QUIRK_NOT_REVIEWABLE);
 -              refine_app (plugin, app, package, TRUE, cancellable);
 +              refine_app (plugin, app, snap, TRUE, cancellable);
                gs_app_list_add (list, app);
        }
  
@@@ -302,9 -302,8 +301,8 @@@ gs_plugin_add_search (GsPlugin *plugin
                gs_app_set_scope (app, AS_APP_SCOPE_SYSTEM);
                gs_app_set_bundle_kind (app, AS_BUNDLE_KIND_SNAP);
                gs_app_set_management_plugin (app, "snap");
-               gs_app_set_kind (app, AS_APP_KIND_DESKTOP);
                gs_app_add_quirk (app, AS_APP_QUIRK_NOT_REVIEWABLE);
 -              refine_app (plugin, app, package, TRUE, cancellable);
 +              refine_app (plugin, app, snap, TRUE, cancellable);
                gs_app_list_add (list, app);
        }
  
@@@ -318,20 -317,24 +316,24 @@@ gs_plugin_refine_app (GsPlugin *plugin
                      GCancellable *cancellable,
                      GError **error)
  {
 -      g_autofree gchar *macaroon = NULL;
 -      g_auto(GStrv) discharges = NULL;
 -      g_autoptr(JsonObject) result = NULL;
 +      g_autoptr(SnapdClient) client = NULL;
 +      g_autoptr(SnapdSnap) snap = NULL;
+       const gchar *id;
  
        /* not us */
        if (g_strcmp0 (gs_app_get_management_plugin (app), "snap") != 0)
                return TRUE;
  
 -      get_macaroon (plugin, &macaroon, &discharges);
 -
 +      client = get_client (plugin, cancellable, error);
 +      if (client == NULL)
 +              return FALSE;
-       snap = snapd_client_list_one_sync (client, gs_app_get_id (app), cancellable, error);
+       id = gs_app_get_id (app);
+       if (id == NULL)
+               id = gs_app_get_source_default (app);
 -      result = gs_snapd_list_one (macaroon, discharges, id, cancellable, error);
 -      if (result == NULL)
++      snap = snapd_client_list_one_sync (client, id, cancellable, error);
 +      if (snap == NULL)
                return FALSE;
 -      refine_app (plugin, app, result, FALSE, cancellable);
 +      refine_app (plugin, app, snap, FALSE, cancellable);
  
        return TRUE;
  }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]