Skip to content

Commit

Permalink
gs-plugin-apk: port launching apps to GS43
Browse files Browse the repository at this point in the history
The code is directly copied from the packagekit plugin and is quite
an usability improvement
  • Loading branch information
pabloyoyoista committed Nov 14, 2022
1 parent 53ccb6d commit 77882f0
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/gs-plugin-apk/gs-plugin-apk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,20 @@ apk_polkit_get_packages_details_cb (GObject *object_source,
g_task_return_boolean (task, TRUE);
}

static gboolean
gs_plugin_apk_filter_desktop_file_cb (GsPlugin *plugin,
GsApp *app,
const gchar *filename,
GKeyFile *key_file)
{
return strstr (filename, "/snapd/") == NULL &&
strstr (filename, "/snap/") == NULL &&
strstr (filename, "/flatpak/") == NULL &&
g_key_file_has_group (key_file, "Desktop Entry") &&
!g_key_file_has_key (key_file, "Desktop Entry", "X-Flatpak", NULL) &&
!g_key_file_has_key (key_file, "Desktop Entry", "X-SnapInstanceName", NULL);
}

gboolean
gs_plugin_launch (GsPlugin *plugin,
GsApp *app,
Expand All @@ -1027,7 +1041,7 @@ gs_plugin_launch (GsPlugin *plugin,
if (!gs_app_has_management_plugin (app, plugin))
return TRUE;

return gs_plugin_app_launch (plugin, app, error);
return gs_plugin_app_launch_filtered (plugin, app, gs_plugin_apk_filter_desktop_file_cb, NULL, error);
}

gboolean
Expand Down

0 comments on commit 77882f0

Please sign in to comment.