[gnome-settings-daemon] media-keys: Fix checking for cancellation



commit 5147e6b0235993747201d05f30b806b71df9b26b
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Mar 15 15:00:57 2016 +0100

    media-keys: 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/media-keys/gsd-media-keys-manager.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)
---
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index f50cdd1..0ad2632 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -3143,15 +3143,10 @@ on_bus_gotten (GObject             *source_object,
         GError *error = NULL;
         UpClient *up_client;
 
-        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]