applications: Fix only connected snap interfaces showing

Not enough information was being queried from snapd.
This commit is contained in:
Robert Ancell 2020-04-16 15:36:48 +12:00
parent 23f8d9134e
commit f246d40e95

View file

@ -635,8 +635,8 @@ add_snap_permissions (CcApplicationsPanel *self,
client = snapd_client_new ();
if (!snapd_client_get_connections2_sync (client,
SNAPD_GET_CONNECTIONS_FLAGS_NONE,
snap_name, NULL,
SNAPD_GET_CONNECTIONS_FLAGS_SELECT_ALL,
NULL, NULL,
NULL, NULL,
&plugs, &slots,
NULL, &error))
@ -658,6 +658,10 @@ add_snap_permissions (CcApplicationsPanel *self,
"x11",
NULL };
/* Skip if not relating to this snap */
if (g_strcmp0 (snapd_plug_get_snap (plug), snap_name) != 0)
continue;
/* Ignore interfaces that are too low level to make sense to show or disable */
if (g_strv_contains (hidden_interfaces, snapd_plug_get_interface (plug)))
continue;