[gnome-software] Fix distro upgrade cancelling



commit 158200f83a286d70ed0323ef14f4bfbbcd6aa8ec
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 e1834fd..433c054 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -1120,8 +1120,8 @@ upgrade_reboot_failed_cb (GObject *source,
                           gpointer user_data)
 {
        GsShellUpdates *self = (GsShellUpdates *) user_data;
+       GsApp *app;
        g_autoptr(GError) error = NULL;
-       g_autoptr(GsAppList) apps = NULL;
        g_autoptr(GVariant) retval = NULL;
 
        /* get result */
@@ -1134,10 +1134,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_list_index (apps, 0),
+                                          app,
                                           GS_PLUGIN_LOADER_ACTION_UPDATE_CANCEL,
                                           self->cancellable,
                                           cancel_trigger_failed_cb,


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