[gnome-software] Set applications to unknown state when the updates cache is changed



commit aec365310409b7aa818015dfbd2ad03322dfbb37
Author: Richard Hughes <richard hughsie com>
Date:   Mon Sep 1 12:10:08 2014 +0100

    Set applications to unknown state when the updates cache is changed

 src/gs-plugin-loader.c                    |   13 ++++++++++++-
 src/plugins/gs-plugin-packagekit-refine.c |    2 --
 2 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index af04846..f6eefb7 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -2502,10 +2502,21 @@ gs_plugin_loader_status_update_cb (GsPlugin *plugin,
 static void
 gs_plugin_loader_updates_changed_cb (GsPlugin *plugin, gpointer user_data)
 {
+       GList *apps;
+       GList *l;
+       GsApp *app;
        GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (user_data);
 
-       /* not valid anymore */
+       /* no longer know the state of these */
        g_mutex_lock (&plugin_loader->priv->app_cache_mutex);
+       apps = g_hash_table_get_values (plugin_loader->priv->app_cache);
+       for (l = apps; l != NULL; l = l->next) {
+               app = GS_APP (l->data);
+               gs_app_set_state (app, AS_APP_STATE_UNKNOWN);
+       }
+       g_list_free (apps);
+
+       /* not valid anymore */
        g_hash_table_remove_all (plugin_loader->priv->app_cache);
        g_mutex_unlock (&plugin_loader->priv->app_cache_mutex);
 
diff --git a/src/plugins/gs-plugin-packagekit-refine.c b/src/plugins/gs-plugin-packagekit-refine.c
index add2908..913a6ec 100644
--- a/src/plugins/gs-plugin-packagekit-refine.c
+++ b/src/plugins/gs-plugin-packagekit-refine.c
@@ -765,8 +765,6 @@ gs_plugin_refine (GsPlugin *plugin,
        gs_profile_start (plugin->profile, "packagekit-refine[name->id]");
        for (l = *list; l != NULL; l = l->next) {
                app = GS_APP (l->data);
-               if (gs_app_get_source_id_default (app) != NULL)
-                       continue;
                if (gs_app_get_id_kind (app) == AS_ID_KIND_WEB_APP)
                        continue;
                sources = gs_app_get_sources (app);


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