[gnome-software] trivial: Show the GsApp's that are detected during reload



commit e89d98984c1b2f0282c40aef3e853e059d06c236
Author: Richard Hughes <richard hughsie com>
Date:   Sat Jun 11 23:39:55 2016 +0100

    trivial: Show the GsApp's that are detected during reload

 src/plugins/gs-plugin-appstream.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index be50e1a..4cec0e3 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -66,6 +66,7 @@ gs_plugin_detect_reload_apps (GsPlugin *plugin)
 {
        GsPluginData *priv = gs_plugin_get_data (plugin);
        AsApp *item;
+       GsApp *app;
        GList *l;
        guint cnt = 0;
        g_autoptr(GHashTable) app_hash = NULL;
@@ -78,8 +79,14 @@ gs_plugin_detect_reload_apps (GsPlugin *plugin)
        for (l = keys; l != NULL; l = l->next) {
                const gchar *key = l->data;
                item = g_hash_table_lookup (priv->app_hash_old, key);
-               if (item == NULL)
+               if (item == NULL) {
+                       item = g_hash_table_lookup (app_hash, key);
+                       app = gs_plugin_cache_lookup (plugin,
+                                                     as_app_get_id (item));
+                       if (app != NULL)
+                               g_debug ("added GsApp %s", gs_app_get_id (app));
                        cnt++;
+               }
        }
 
        /* find packages that have been removed */
@@ -87,8 +94,14 @@ gs_plugin_detect_reload_apps (GsPlugin *plugin)
        for (l = keys_old; l != NULL; l = l->next) {
                const gchar *key = l->data;
                item = g_hash_table_lookup (app_hash, key);
-               if (item == NULL)
+               if (item == NULL) {
+                       item = g_hash_table_lookup (priv->app_hash_old, key);
+                       app = gs_plugin_cache_lookup (plugin,
+                                                     as_app_get_id (item));
+                       if (app != NULL)
+                               g_debug ("removed GsApp %s", gs_app_get_id (app));
                        cnt++;
+               }
        }
 
        /* replace if any changes */


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