[gnome-software/wip/temp/ubuntu-xenial-rebased: 211/326] Only show the session manager restart if there were any non-live updates



commit 63c7d78f64ff5bb3bf2118526610329e8833e1f7
Author: Richard Hughes <richard hughsie com>
Date:   Fri Apr 8 09:33:05 2016 +0100

    Only show the session manager restart if there were any non-live updates

 src/gs-shell-updates.c |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)
---
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index 79d73b2..cae7551 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -965,7 +965,6 @@ gs_shell_updates_perform_update_cb (GsPluginLoader *plugin_loader,
                                     GAsyncResult *res,
                                     GsShellUpdates *self)
 {
-       g_autoptr(GDBusConnection) bus = NULL;
        g_autoptr(GError) error = NULL;
 
        /* get the results */
@@ -974,17 +973,20 @@ gs_shell_updates_perform_update_cb (GsPluginLoader *plugin_loader,
                return;
        }
 
-       /* trigger reboot */
-       bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
-       g_dbus_connection_call (bus,
-                               "org.gnome.SessionManager",
-                               "/org/gnome/SessionManager",
-                               "org.gnome.SessionManager",
-                               "Reboot",
-                               NULL, NULL, G_DBUS_CALL_FLAGS_NONE,
-                               G_MAXINT, NULL,
-                               gs_shell_updates_reboot_failed_cb,
-                               self);
+       /* trigger reboot if any application was not updatable live */
+       if (!self->all_updates_are_live) {
+               g_autoptr(GDBusConnection) bus = NULL;
+               bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
+               g_dbus_connection_call (bus,
+                                       "org.gnome.SessionManager",
+                                       "/org/gnome/SessionManager",
+                                       "org.gnome.SessionManager",
+                                       "Reboot",
+                                       NULL, NULL, G_DBUS_CALL_FLAGS_NONE,
+                                       G_MAXINT, NULL,
+                                       gs_shell_updates_reboot_failed_cb,
+                                       self);
+       }
 }
 
 static void


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