[gnome-software] Do not unschedule the offline update if reboot fails



commit eb0a326cc00c26d05a19946c4d218a208febd838
Author: Richard Hughes <richard hughsie com>
Date:   Wed Jan 27 10:05:03 2016 +0000

    Do not unschedule the offline update if reboot fails
    
    If we're using gnome-software in XFCE or KDE then the user can still reboot
    manually and take advantage of the offline update service.

 src/gs-application.c   |   11 +----------
 src/gs-shell-updates.c |   11 +----------
 src/gs-utils.c         |    3 ++-
 3 files changed, 4 insertions(+), 21 deletions(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index 8f14396..157d500 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -30,7 +30,6 @@
 #include <gio/gio.h>
 #include <gio/gdesktopappinfo.h>
 #include <libsoup/soup.h>
-#include <packagekit-glib2/packagekit.h>
 
 #ifdef GDK_WINDOWING_X11
 #include <gtk/gtkx.h>
@@ -365,14 +364,6 @@ profile_activated (GSimpleAction *action,
        as_profile_dump (app->profile);
 }
 
-static void
-offline_updates_cancel (void)
-{
-       g_autoptr(GError) error = NULL;
-       if (!pk_offline_cancel (NULL, &error))
-               g_warning ("failed to cancel the offline update: %s", error->message);
-}
-
 /**
  * offline_update_cb:
  **/
@@ -386,7 +377,7 @@ offline_update_cb (GsPluginLoader *plugin_loader,
                g_warning ("Failed to trigger offline update: %s", error->message);
                return;
        }
-       gs_reboot (offline_updates_cancel);
+       gs_reboot (NULL);
 }
 
 static void
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index 127f8e5..5139185 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -23,7 +23,6 @@
 
 #include <glib/gi18n.h>
 #include <gio/gio.h>
-#include <packagekit-glib2/packagekit.h>
 
 #include "gs-shell.h"
 #include "gs-shell-updates.h"
@@ -814,14 +813,6 @@ gs_shell_updates_pending_apps_changed_cb (GsPluginLoader *plugin_loader,
        gs_shell_updates_invalidate (self);
 }
 
-static void
-gs_offline_updates_cancel (void)
-{
-       g_autoptr(GError) error = NULL;
-       if (!pk_offline_cancel (NULL, &error))
-               g_warning ("failed to cancel the offline update: %s", error->message);
-}
-
 /**
  * gs_shell_updates_offline_update_cb:
  **/
@@ -837,7 +828,7 @@ gs_shell_updates_offline_update_cb (GsPluginLoader *plugin_loader,
                g_warning ("Failed to trigger offline update: %s", error->message);
                return;
        }
-       gs_reboot (gs_offline_updates_cancel);
+       gs_reboot (NULL);
 }
 
 static void
diff --git a/src/gs-utils.c b/src/gs-utils.c
index c9b7d33..648c1f6 100644
--- a/src/gs-utils.c
+++ b/src/gs-utils.c
@@ -411,7 +411,8 @@ reboot_done (GObject *source, GAsyncResult *res, gpointer data)
                           error->message);
        }
 
-       reboot_failed ();
+       if (reboot_failed != NULL)
+               reboot_failed ();
 }
 
 void


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