[gnome-software] Invalidate the upgrade if the update list is changed
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Invalidate the upgrade if the update list is changed
- Date: Wed, 25 May 2016 10:33:51 +0000 (UTC)
commit 5a4b61bef7ec3b181221f8b583282850e2b58988
Author: Richard Hughes <richard hughsie com>
Date: Wed May 25 11:17:29 2016 +0100
Invalidate the upgrade if the update list is changed
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1336459
src/gs-shell-updates.c | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index 5d52647..83c8062 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -1201,6 +1201,28 @@ gs_shell_updates_upgrade_help_cb (GsUpgradeBanner *upgrade_banner,
g_warning ("failed to open %s: %s", uri, error->message);
}
+static void
+gs_shell_updates_invalidate_downloaded_upgrade (GsShellUpdates *self)
+{
+ GsApp *app;
+ app = gs_upgrade_banner_get_app (GS_UPGRADE_BANNER (self->upgrade_banner));
+ if (app == NULL)
+ return;
+ if (gs_app_get_state (app) != AS_APP_STATE_UPDATABLE)
+ return;
+ g_debug ("resetting %s to AVAILABLE as the updates have changed",
+ gs_app_get_id (app));
+}
+
+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 */
+ gs_shell_updates_invalidate_downloaded_upgrade (self);
+}
+
/**
* gs_shell_updates_status_changed_cb:
**/
@@ -1265,6 +1287,9 @@ gs_shell_updates_setup (GsShellUpdates *self,
g_signal_connect (self->plugin_loader, "status-changed",
G_CALLBACK (gs_shell_updates_status_changed_cb),
self);
+ g_signal_connect (self->plugin_loader, "updates-changed",
+ G_CALLBACK (gs_shell_updates_changed_cb),
+ self);
self->builder = g_object_ref (builder);
self->cancellable = g_object_ref (cancellable);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]