[gnome-software] shell extensions: Fix cache lookup when adding installed apps



commit dae1ade0c6d34118814de953ac24e2014393bd3c
Author: Kalev Lember <klember redhat com>
Date:   Wed Feb 21 08:37:26 2018 +0100

    shell extensions: Fix cache lookup when adding installed apps
    
    We weren't actually using the cached data, but instead parsing again
    each time.

 plugins/shell-extensions/gs-plugin-shell-extensions.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/plugins/shell-extensions/gs-plugin-shell-extensions.c 
b/plugins/shell-extensions/gs-plugin-shell-extensions.c
index 1a5c4158..97eff17c 100644
--- a/plugins/shell-extensions/gs-plugin-shell-extensions.c
+++ b/plugins/shell-extensions/gs-plugin-shell-extensions.c
@@ -343,12 +343,13 @@ gs_plugin_add_installed (GsPlugin *plugin,
 
                /* search in the cache */
                app = gs_plugin_cache_lookup (plugin, ext_uuid);
-               if (app == NULL) {
-                       app = gs_app_new (NULL);
+               if (app != NULL) {
                        gs_app_list_add (list, app);
+                       continue;
                }
 
                /* parse the data into an GsApp */
+               app = gs_app_new (NULL);
                ret = gs_plugin_shell_extensions_add_app (plugin,
                                                          app,
                                                          ext_uuid,


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