[gnome-software] trivial: Only allow unique IDs when using --details



commit 72bdefb1751f935a2713e67605fd4cedbdb9c440
Author: Richard Hughes <richard hughsie com>
Date:   Fri Jan 13 15:38:34 2017 +0000

    trivial: Only allow unique IDs when using --details
    
    Using the fallback means we don't get the device from the global cache and the
    objects might get out of sync.

 src/gs-application.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index ae7b92a..7d167c0 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -541,12 +541,11 @@ details_activated (GSimpleAction *action,
                gs_shell_show_search_result (app->shell, id, search);
        else {
                g_autoptr (GsApp) a = NULL;
-
-               if (as_utils_unique_id_valid (id))
-                       a = gs_plugin_loader_app_create (app->plugin_loader, id);
-               else
-                       a = gs_app_new (id);
-
+               if (!as_utils_unique_id_valid (id)) {
+                       g_warning ("Need to use a valid unique-id: %s", id);
+                       return;
+               }
+               a = gs_plugin_loader_app_create (app->plugin_loader, id);
                gs_shell_show_app (app->shell, a);
        }
 }


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