[gnome-software] snap: Fix incorrect usage of new connections API



commit c8d2b92e2aca98ae67da67ac3234ff2b27ce37f2
Author: Robert Ancell <robert ancell canonical com>
Date:   Tue Jul 16 17:06:22 2019 +1200

    snap: Fix incorrect usage of new connections API
    
    It's a low risk case, but we an unconnected plug could be missed making us
    think a snap is not graphical.

 contrib/gnome-software.spec.in | 2 +-
 meson.build                    | 2 +-
 plugins/snap/gs-plugin-snap.c  | 5 ++++-
 3 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/contrib/gnome-software.spec.in b/contrib/gnome-software.spec.in
index b03e4022..a770c67c 100644
--- a/contrib/gnome-software.spec.in
+++ b/contrib/gnome-software.spec.in
@@ -47,7 +47,7 @@ BuildRequires: libgudev1-devel
 BuildRequires: valgrind-devel
 BuildRequires: liboauth-devel
 %if 0%{?fedora}
-BuildRequires: snapd-glib-devel >= 1.48
+BuildRequires: snapd-glib-devel >= 1.49
 %endif
 
 Requires: appstream-data
diff --git a/meson.build b/meson.build
index 51c5648a..37206d7d 100644
--- a/meson.build
+++ b/meson.build
@@ -173,7 +173,7 @@ if get_option('gudev')
 endif
 
 if get_option('snap')
-  snap = dependency('snapd-glib', version : '>= 1.48')
+  snap = dependency('snapd-glib', version : '>= 1.49')
 endif
 
 gnome = import('gnome')
diff --git a/plugins/snap/gs-plugin-snap.c b/plugins/snap/gs-plugin-snap.c
index 9e84f0b0..3cd749c1 100644
--- a/plugins/snap/gs-plugin-snap.c
+++ b/plugins/snap/gs-plugin-snap.c
@@ -986,7 +986,10 @@ is_graphical (GsPlugin *plugin, GsApp *app, GCancellable *cancellable)
        if (client == NULL)
                return FALSE;
 
-       if (!snapd_client_get_connections_sync (client, NULL, NULL, &plugs, NULL, cancellable, &error)) {
+       if (!snapd_client_get_connections2_sync (client,
+                                                SNAPD_GET_CONNECTIONS_FLAGS_SELECT_ALL, NULL, NULL,
+                                                NULL, NULL, &plugs, NULL,
+                                                cancellable, &error)) {
                g_warning ("Failed to get connections: %s", error->message);
                return FALSE;
        }


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