diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2012-02-17 08:34:26 -0600 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2012-02-17 08:34:26 -0600 |
commit | e1c4456df917b94c413f5a4ff4e57df886b190c7 (patch) | |
tree | 8c761752ea6479c34c08c5ccf025c6fdc9578c5e | |
parent | 1651ec12b187309fbf8934d37540e38a515409dd (diff) | |
parent | 94398e25e2d4bc74cee310c50c25bf129ee9625e (diff) | |
download | ayatana-indicator-power-e1c4456df917b94c413f5a4ff4e57df886b190c7.tar.gz ayatana-indicator-power-e1c4456df917b94c413f5a4ff4e57df886b190c7.tar.bz2 ayatana-indicator-power-e1c4456df917b94c413f5a4ff4e57df886b190c7.zip |
Listen for the "g-properties-changed" signal instead of the "g-signal" signal from its GDBusProxy to fix bug #933466.
-rw-r--r-- | src/indicator-power.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/src/indicator-power.c b/src/indicator-power.c index 3980988..a5092c1 100644 --- a/src/indicator-power.c +++ b/src/indicator-power.c @@ -840,26 +840,22 @@ update_visibility (IndicatorPower * self) } static void -receive_signal (GDBusProxy *proxy, - gchar *sender_name, - gchar *signal_name, - GVariant *parameters, - gpointer user_data) +receive_properties_changed (GDBusProxy *proxy G_GNUC_UNUSED, + GVariant *changed_properties G_GNUC_UNUSED, + GStrv invalidated_properties G_GNUC_UNUSED, + gpointer user_data) { IndicatorPower *self = INDICATOR_POWER (user_data); - if (g_strcmp0 (signal_name, "Changed") == 0) - { - /* get the new state */ - g_dbus_proxy_call (self->proxy, - "GetDevices", - NULL, - G_DBUS_CALL_FLAGS_NONE, - -1, - self->proxy_cancel, - get_devices_cb, - user_data); - } + /* it's time to refresh our device list */ + g_dbus_proxy_call (self->proxy, + "GetDevices", + NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, + self->proxy_cancel, + get_devices_cb, + user_data); } static void @@ -884,8 +880,8 @@ service_proxy_cb (GObject *object, /* we want to change the primary device changes */ g_signal_connect (self->proxy, - "g-signal", - G_CALLBACK (receive_signal), + "g-properties-changed", + G_CALLBACK (receive_properties_changed), user_data); /* get the initial state */ |