[gnome-software/wip/kalev/open-details-page: 2/2] Open the details page when using --details, not the search page
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/kalev/open-details-page: 2/2] Open the details page when using --details, not the search page
- Date: Mon, 19 Nov 2018 11:29:42 +0000 (UTC)
commit 94b867b67f95ae8f042bbf232d95c8952aab6598
Author: Kalev Lember <klember redhat com>
Date: Sun Nov 18 11:55:30 2018 +0100
Open the details page when using --details, not the search page
This used to work once upon a time, but things broke after the
introduction of the unique ID concept. GNOME Shell passes just the
desktop ID and never the unique ID and we broke the API on
gnome-software side expecting to get unique ID.
Fix this by using unique ID when it's passed in, and just the desktop
file name if that's what was passed in.
Also, never show the search page with --details as this seems like poor
user interaction (right click on an app in GNOME Shell, select "Show
Details" and then we get a search page).
Fixes: https://gitlab.gnome.org/GNOME/gnome-software/issues/529
src/gs-application.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index d81f18be..0fd49493 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -573,17 +573,12 @@ details_activated (GSimpleAction *action,
if (search != NULL && search[0] != '\0')
gs_shell_show_search_result (app->shell, id, search);
else {
- if (as_utils_unique_id_valid (id)) {
- g_autoptr (GsApp) a = NULL;
+ g_autoptr (GsApp) a = NULL;
+ if (as_utils_unique_id_valid (id))
a = gs_plugin_loader_app_create (app->plugin_loader, id);
- 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);
- }
+ else
+ a = gs_app_new (id);
+ gs_shell_show_app (app->shell, a);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]