[gnome-control-center] power: add debug output when IIO proxy creation fails



commit 3af59f7c03cb81c7f9801890415bcef1dea76820
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Sep 8 10:01:21 2015 -0700

    power: add debug output when IIO proxy creation fails
    
    https://bugzilla.gnome.org/show_bug.cgi?id=754735

 panels/power/cc-power-panel.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/panels/power/cc-power-panel.c b/panels/power/cc-power-panel.c
index 7552c05..b694989 100644
--- a/panels/power/cc-power-panel.c
+++ b/panels/power/cc-power-panel.c
@@ -1506,6 +1506,8 @@ iio_proxy_appeared_cb (GDBusConnection *connection,
                        gpointer user_data)
 {
   CcPowerPanel *self = CC_POWER_PANEL (user_data);
+  GError *error = NULL;
+
   self->priv->iio_proxy =
     g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
                                    G_DBUS_PROXY_FLAGS_NONE,
@@ -1513,7 +1515,14 @@ iio_proxy_appeared_cb (GDBusConnection *connection,
                                    "net.hadess.SensorProxy",
                                    "/net/hadess/SensorProxy",
                                    "net.hadess.SensorProxy",
-                                   NULL, NULL);
+                                   NULL, &error);
+  if (error != NULL)
+    {
+      g_warning ("Could not create IIO sensor proxy: %s", error->message);
+      g_error_free (error);
+      return;
+    }
+
   g_signal_connect_swapped (G_OBJECT (self->priv->iio_proxy), "g-properties-changed",
                             G_CALLBACK (als_enabled_state_changed), self);
   als_enabled_state_changed (self);


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