[gnome-software] Make --details work again



commit 0dfa594961af61561c12c2e7fa3a276d3b682ea9
Author: Kalev Lember <kalevlember gmail com>
Date:   Mon Oct 6 13:07:01 2014 +0200

    Make --details work again
    
    Commit a69e779204348fc264185388d1a40f3bf602445e regressed this.

 src/gs-application.c |    5 ++++-
 src/gs-shell.c       |   21 ++++++++++++++-------
 src/gs-shell.h       |    2 ++
 3 files changed, 20 insertions(+), 8 deletions(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index 508868f..ac26ade 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -380,7 +380,10 @@ details_activated (GSimpleAction *action,
        gs_application_initialize_ui (app);
 
        g_variant_get (parameter, "(&s&s)", &id, &search);
-       gs_shell_show_search_result (app->shell, id, search);
+       if (search != NULL && search[0] != '\0')
+               gs_shell_show_search_result (app->shell, id, search);
+       else
+               gs_shell_show_details (app->shell, id);
 }
 
 static void
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 51651a1..eeee649 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -760,16 +760,23 @@ gs_shell_show_search_result (GsShell *shell, const gchar *id, const gchar *searc
        GsShellPrivate *priv = shell->priv;
        GtkWidget *widget;
 
-       if (search != NULL && search[0] != '\0') {
-               widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "entry_search"));
-               gtk_entry_set_text (GTK_ENTRY (widget), search);
-               gs_shell_search_set_appid_to_show (priv->shell_search, id);
-               gs_shell_search_switch_to (priv->shell_search, search, TRUE);
+       widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "entry_search"));
+       gtk_entry_set_text (GTK_ENTRY (widget), search);
+       gs_shell_search_set_appid_to_show (priv->shell_search, id);
+       gs_shell_search_switch_to (priv->shell_search, search, TRUE);
 
-               gs_shell_change_mode (shell, GS_SHELL_MODE_SEARCH, NULL, NULL, TRUE);
-       }
+       gs_shell_change_mode (shell, GS_SHELL_MODE_SEARCH, NULL, NULL, TRUE);
 }
 
+void
+gs_shell_show_details (GsShell *shell, const gchar *id)
+{
+       GsApp *app;
+
+       app = gs_app_new (id);
+       gs_shell_show_app (shell, app);
+       g_object_unref (app);
+}
 
 /**
  * gs_shell_class_init:
diff --git a/src/gs-shell.h b/src/gs-shell.h
index d051c58..fdf8691 100644
--- a/src/gs-shell.h
+++ b/src/gs-shell.h
@@ -86,6 +86,8 @@ void           gs_shell_show_filename         (GsShell        *shell,
 void            gs_shell_show_search_result    (GsShell        *shell,
                                                 const gchar    *id,
                                                 const gchar    *search);
+void            gs_shell_show_details          (GsShell        *shell,
+                                                const gchar    *id);
 void            gs_shell_setup                 (GsShell        *shell,
                                                 GsPluginLoader *plugin_loader,
                                                 GCancellable   *cancellable);


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