[gnome-software] Invalidate the OS upgrade state for any install or remove



commit 3809709fed6a3c98f40c9c179ee06772f5250af1
Author: Richard Hughes <richard hughsie com>
Date:   Thu May 26 14:56:57 2016 +0100

    Invalidate the OS upgrade state for any install or remove
    
    We're not emitting updates-changed for a simple action.

 src/gs-shell-updates.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index bab82a1..c0abb23 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -1213,8 +1213,8 @@ static void
 gs_shell_updates_changed_cb (GsPluginLoader *plugin_loader,
                             GsShellUpdates *self)
 {
-       /* if we do a install, remove or live update and the upgrade is waiting
-        * to be deployed then make sure all new packages are downloaded */
+       /* if we do a live update and the upgrade is waiting to be deployed
+        * then make sure all new packages are downloaded */
        gs_shell_updates_invalidate_downloaded_upgrade (self);
 }
 
@@ -1227,6 +1227,20 @@ gs_shell_updates_status_changed_cb (GsPluginLoader *plugin_loader,
                                    GsPluginStatus status,
                                    GsShellUpdates *self)
 {
+       switch (status) {
+       case GS_PLUGIN_STATUS_INSTALLING:
+       case GS_PLUGIN_STATUS_REMOVING:
+               if (gs_app_get_kind (app) != AS_APP_KIND_OS_UPGRADE &&
+                   gs_app_get_id (app) != NULL) {
+                       /* if we do a install or remove then make sure all new
+                        * packages are downloaded */
+                       gs_shell_updates_invalidate_downloaded_upgrade (self);
+               }
+               break;
+       default:
+               break;
+       }
+
        self->last_status = status;
        gs_shell_updates_update_ui_state (self);
 }


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