[gnome-settings-daemon/gnome-3-18] media-keys: Don't print warning on call cancellation
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/gnome-3-18] media-keys: Don't print warning on call cancellation
- Date: Wed, 16 Mar 2016 11:23:33 +0000 (UTC)
commit f5c6eed04e660919ea6ea19b79b985f797a0d834
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 917b47c..8e5d4f3 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -2566,7 +2566,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);
@@ -2666,7 +2667,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);
}
}
@@ -2680,8 +2682,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);
}
}
@@ -2695,8 +2698,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);
}
}
@@ -2710,8 +2714,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]