[gnome-settings-daemon] media-keys: Don't print warning on call cancellation



commit 86cbfdabb0c69260913baf3ec172855442a0b4a5
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Mar 15 15:00:30 2016 +0100

    media-keys: Don't print warning on call cancellation
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763689

 plugins/media-keys/gsd-media-keys-manager.c |   21 +++++++++++++--------
 plugins/media-keys/mpris-controller.c       |    3 ++-
 2 files changed, 15 insertions(+), 9 deletions(-)
---
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index e3cc47e..f50cdd1 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -2979,7 +2979,8 @@ inhibit_done (GObject      *source,
 
         res = g_dbus_proxy_call_with_unix_fd_list_finish (proxy, &fd_list, result, &error);
         if (res == NULL) {
-                g_warning ("Unable to inhibit keypresses: %s", error->message);
+                if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+                        g_warning ("Unable to inhibit keypresses: %s", error->message);
                 g_error_free (error);
         } else {
                 g_variant_get (res, "(h)", &idx);
@@ -3079,7 +3080,8 @@ xrandr_ready_cb (GObject             *source_object,
 
         manager->priv->xrandr_proxy = g_dbus_proxy_new_finish (res, &error);
         if (manager->priv->xrandr_proxy == NULL) {
-                g_warning ("Failed to get proxy for XRandR operations: %s", error->message);
+                if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+                        g_warning ("Failed to get proxy for XRandR operations: %s", error->message);
                 g_error_free (error);
         }
 }
@@ -3093,8 +3095,9 @@ power_ready_cb (GObject             *source_object,
 
         manager->priv->power_proxy = g_dbus_proxy_new_finish (res, &error);
         if (manager->priv->power_proxy == NULL) {
-                g_warning ("Failed to get proxy for power: %s",
-                           error->message);
+                if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+                        g_warning ("Failed to get proxy for power: %s",
+                                   error->message);
                 g_error_free (error);
         }
 }
@@ -3108,8 +3111,9 @@ power_screen_ready_cb (GObject             *source_object,
 
         manager->priv->power_screen_proxy = g_dbus_proxy_new_finish (res, &error);
         if (manager->priv->power_screen_proxy == NULL) {
-                g_warning ("Failed to get proxy for power (screen): %s",
-                           error->message);
+                if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+                        g_warning ("Failed to get proxy for power (screen): %s",
+                                   error->message);
                 g_error_free (error);
         }
 }
@@ -3123,8 +3127,9 @@ power_keyboard_ready_cb (GObject             *source_object,
 
         manager->priv->power_keyboard_proxy = g_dbus_proxy_new_finish (res, &error);
         if (manager->priv->power_keyboard_proxy == NULL) {
-                g_warning ("Failed to get proxy for power (keyboard): %s",
-                           error->message);
+                if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+                        g_warning ("Failed to get proxy for power (keyboard): %s",
+                                   error->message);
                 g_error_free (error);
         }
 }
diff --git a/plugins/media-keys/mpris-controller.c b/plugins/media-keys/mpris-controller.c
index 00cabda..c20d44a 100644
--- a/plugins/media-keys/mpris-controller.c
+++ b/plugins/media-keys/mpris-controller.c
@@ -68,7 +68,8 @@ mpris_proxy_call_done (GObject      *object,
 
   if (!(ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (object), res, &error)))
     {
-      g_warning ("Error calling method %s", error->message);
+      if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+        g_warning ("Error calling method %s", error->message);
       g_clear_error (&error);
       return;
     }


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