[gnome-settings-daemon/gnome-3-18] housekeeping: Fix checking for cancellation



commit b5d01e33cc8bbbe3c0cf3c537213a5ed877a146f
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Mar 15 14:56:31 2016 +0100

    housekeeping: Fix checking for cancellation
    
    We really don't need to call g_cancellable_is_cancelled() when we could
    just check the error code we get back.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763689

 plugins/housekeeping/gsd-housekeeping-manager.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)
---
diff --git a/plugins/housekeeping/gsd-housekeeping-manager.c b/plugins/housekeeping/gsd-housekeeping-manager.c
index df0ff3a..aa3c769 100644
--- a/plugins/housekeeping/gsd-housekeeping-manager.c
+++ b/plugins/housekeeping/gsd-housekeeping-manager.c
@@ -334,15 +334,10 @@ on_bus_gotten (GObject                *source_object,
         GDBusInterfaceInfo **infos;
         int i;
 
-        if (manager->priv->bus_cancellable == NULL ||
-            g_cancellable_is_cancelled (manager->priv->bus_cancellable)) {
-                g_warning ("Operation has been cancelled, so not retrieving session bus");
-                return;
-        }
-
         connection = g_bus_get_finish (res, &error);
         if (connection == NULL) {
-                g_warning ("Could not get session bus: %s", error->message);
+                if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+                        g_warning ("Could not get session bus: %s", error->message);
                 g_error_free (error);
                 return;
         }


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