[gnome-software/gnome-3-30] updates section: Refresh button states when updating fails



commit 91ccfe5365c80f2d44f8c813ffcaf06e8e09dbd7
Author: Kalev Lember <klember redhat com>
Date:   Wed Oct 3 16:46:08 2018 +0200

    updates section: Refresh button states when updating fails
    
    Otherwise we get a grayed out Cancel button that never goes away.

 src/gs-updates-section.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/gs-updates-section.c b/src/gs-updates-section.c
index 4e857d37..f5f701dd 100644
--- a/src/gs-updates-section.c
+++ b/src/gs-updates-section.c
@@ -278,7 +278,7 @@ _perform_update_cb (GsPluginLoader *plugin_loader, GAsyncResult *res, gpointer u
        if (!gs_plugin_loader_job_action_finish (plugin_loader, res, &error)) {
                if (!g_error_matches (error, GS_PLUGIN_ERROR, GS_PLUGIN_ERROR_CANCELLED))
                        g_warning ("failed to perform update: %s", error->message);
-               return;
+               goto out;
        }
 
        /* trigger reboot if any application was not updatable live */
@@ -311,6 +311,8 @@ _perform_update_cb (GsPluginLoader *plugin_loader, GAsyncResult *res, gpointer u
                g_notification_set_priority (n, G_NOTIFICATION_PRIORITY_URGENT);
                g_application_send_notification (g_application_get_default (), "restart-required", n);
        }
+
+out:
        g_clear_object (&self->cancellable);
        _update_buttons (self);
 }


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