[gnome-control-center] power: register for "g-properties-changed" rather than "g-signal"



commit bac76fa3876bfe5b073a64ebec7592abc9c99f61
Author: Javier JardÃn <jjardon gnome org>
Date:   Fri Feb 17 13:42:36 2012 +0000

    power: register for "g-properties-changed" rather than "g-signal"
    
    This is due this change in gnome-settings-daemon:
    http://git.gnome.org/browse/gnome-settings-daemon/commit/?id=07b1ed63016f1725be251fa6ce8c15e0498539b5
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=670285

 panels/power/cc-power-panel.c |   34 +++++++++++++++-------------------
 1 files changed, 15 insertions(+), 19 deletions(-)
---
diff --git a/panels/power/cc-power-panel.c b/panels/power/cc-power-panel.c
index 85ab7c4..a882bb1 100644
--- a/panels/power/cc-power-panel.c
+++ b/panels/power/cc-power-panel.c
@@ -746,26 +746,22 @@ get_devices_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
 }
 
 static void
-on_signal (GDBusProxy *proxy,
-           gchar      *sender_name,
-           gchar      *signal_name,
-           GVariant   *parameters,
-           gpointer    user_data)
+on_properties_changed (GDBusProxy *proxy,
+                       GVariant   *changed_properties,
+                       GStrv       invalidated_properties,
+                       gpointer    user_data)
 {
   CcPowerPanelPrivate *priv = CC_POWER_PANEL (user_data)->priv;
 
-  if (g_strcmp0 (signal_name, "Changed") == 0)
-    {
-      /* get the new state */
-      g_dbus_proxy_call (priv->proxy,
-                         "GetDevices",
-                         NULL,
-                         G_DBUS_CALL_FLAGS_NONE,
-                         -1,
-                         priv->cancellable,
-                         get_devices_cb,
-                         user_data);
-    }
+  /* get the new state */
+  g_dbus_proxy_call (priv->proxy,
+                     "GetDevices",
+                     NULL,
+                     G_DBUS_CALL_FLAGS_NONE,
+                     -1,
+                     priv->cancellable,
+                     get_devices_cb,
+                     user_data);
 }
 
 static void
@@ -784,8 +780,8 @@ got_power_proxy_cb (GObject *source_object, GAsyncResult *res, gpointer user_dat
 
   /* we want to change the primary device changes */
   g_signal_connect (priv->proxy,
-                    "g-signal",
-                    G_CALLBACK (on_signal),
+                    "g-properties-changed",
+                    G_CALLBACK (on_properties_changed),
                     user_data);
 
   /* get the initial state */



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