[gnome-settings-daemon] power: Print warning when GetActive() fails



commit ee2607a0b911092118559e15047b5445130bb9ab
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Jan 21 11:32:54 2013 +0100

    power: Print warning when GetActive() fails

 plugins/power/gsd-power-manager.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 376a98e..2e68282 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -2813,11 +2813,15 @@ get_active_cb (GDBusProxy *proxy,
 {
         GVariant *res;
         gboolean active = FALSE;
+        GError *error = NULL;
 
-        res = g_dbus_proxy_call_finish (proxy, result, NULL);
-        if (res)
-                g_variant_get (res, "(b)", &active);
+        res = g_dbus_proxy_call_finish (proxy, result, &error);
+        if (!res) {
+                g_warning ("Failed to run GetActive() function on screensaver: %s", error->message);
+                g_error_free (error);
+        }
 
+        g_variant_get (res, "(b)", &active);
         manager->priv->screensaver_active = active;
         g_variant_unref (res);
 }



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