[gnome-software] Fix the 'Show Details' context menu item in GNOME Shell
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Fix the 'Show Details' context menu item in GNOME Shell
- Date: Tue, 2 May 2017 09:04:12 +0000 (UTC)
commit 381765fece275e39886b4889d3012a84cba9c93a
Author: Richard Hughes <richard hughsie com>
Date: Tue May 2 10:03:15 2017 +0100
Fix the 'Show Details' context menu item in GNOME Shell
We have to search for the ID for two reasons:
* Not all plugins can 'adopt' a base GsApp, e.g. flatpak
* There may be multiple plugins or multiple sources providing the same desktop ID
Resolves: https://bugzilla.gnome.org/show_bug.cgi?id=781210
src/gs-application.c | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index 237774a..3e46783 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -547,14 +547,17 @@ details_activated (GSimpleAction *action,
if (search != NULL && search[0] != '\0')
gs_shell_show_search_result (app->shell, id, search);
else {
- g_autoptr (GsApp) a = NULL;
-
- if (as_utils_unique_id_valid (id))
+ if (as_utils_unique_id_valid (id)) {
+ g_autoptr (GsApp) a = NULL;
a = gs_plugin_loader_app_create (app->plugin_loader, id);
- else
- a = gs_app_new (id);
-
- gs_shell_show_app (app->shell, a);
+ gs_shell_show_app (app->shell, a);
+ } else {
+ g_autofree gchar *id_fn = g_strdup (id);
+ gchar *str = g_strrstr (id_fn, ".desktop");
+ if (str != NULL)
+ *str = '\0';
+ gs_shell_show_search (app->shell, id_fn);
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]