[gnome-software/gnome-3-20] Fix distro upgrade cancelling



commit 673ee45daffb5d6661aa660016556b2f102725b0
Author: Kalev Lember <klember redhat com>
Date:   Mon Jun 13 15:56:27 2016 +0200

    Fix distro upgrade cancelling
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1335463

 src/gs-shell-updates.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index 83ffb6c..dec60e0 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -1080,8 +1080,8 @@ upgrade_reboot_failed_cb (GObject *source,
                           gpointer user_data)
 {
        GsShellUpdates *self = (GsShellUpdates *) user_data;
+       GsApp *app;
        g_autoptr(GError) error = NULL;
-       g_autoptr(GList) apps = NULL;
        g_autoptr(GVariant) retval = NULL;
 
        /* get result */
@@ -1094,10 +1094,15 @@ upgrade_reboot_failed_cb (GObject *source,
                           error->message);
        }
 
+       app = gs_upgrade_banner_get_app (GS_UPGRADE_BANNER (self->upgrade_banner));
+       if (app == NULL) {
+               g_warning ("no upgrade to cancel");
+               return;
+       }
+
        /* cancel trigger */
-       apps = gs_update_list_get_apps (GS_UPDATE_LIST (self->list_box_updates));
        gs_plugin_loader_app_action_async (self->plugin_loader,
-                                          GS_APP (apps->data),
+                                          app,
                                           GS_PLUGIN_LOADER_ACTION_OFFLINE_UPDATE_CANCEL,
                                           self->cancellable,
                                           cancel_trigger_failed_cb,


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