aboutsummaryrefslogtreecommitdiff
path: root/libindicator/indicator-service-manager.c
diff options
context:
space:
mode:
authorKen VanDine <ken.vandine@canonical.com>2011-07-15 09:00:15 -0400
committerKen VanDine <ken.vandine@canonical.com>2011-07-15 09:00:15 -0400
commit2801a022058b7ea507972a4227b5ba4433f06843 (patch)
tree5cd2eef07f21b5d86ad37b25f86d820672e81367 /libindicator/indicator-service-manager.c
parentb414e0f54fb79b8131f13eb30a7d4e3e33c60472 (diff)
parent8641c27434f27843185299a6c76e70f2e87ff5d9 (diff)
downloadlibayatana-indicator-2801a022058b7ea507972a4227b5ba4433f06843.tar.gz
libayatana-indicator-2801a022058b7ea507972a4227b5ba4433f06843.tar.bz2
libayatana-indicator-2801a022058b7ea507972a4227b5ba4433f06843.zip
* New upstream release.
* Fix signals with NULL entries in the loader * Adding a comment for setting up debugging options * Adding annotations for GIR files * Fixing watchers hashtable to detect when we have none * Fix testing so no tests are XFAIL anymore * Adding a replace mode for testing indicator services * Watching new services when the name switches
Diffstat (limited to 'libindicator/indicator-service-manager.c')
-rw-r--r--libindicator/indicator-service-manager.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/libindicator/indicator-service-manager.c b/libindicator/indicator-service-manager.c
index f3a29d0..f58c148 100644
--- a/libindicator/indicator-service-manager.c
+++ b/libindicator/indicator-service-manager.c
@@ -536,8 +536,9 @@ service_proxy_name_changed (GDBusConnection * connection, const gchar * sender_n
{
IndicatorServiceManagerPrivate * priv = INDICATOR_SERVICE_MANAGER_GET_PRIVATE(user_data);
- const gchar * new_name;
- g_variant_get(parameters, "(&s&s&s)", NULL, NULL, &new_name);
+ const gchar * new_name = NULL;
+ const gchar * prev_name = NULL;
+ g_variant_get(parameters, "(&s&s&s)", NULL, &prev_name, &new_name);
if (new_name == NULL || new_name[0] == 0) {
if (priv->connected) {
@@ -547,10 +548,27 @@ service_proxy_name_changed (GDBusConnection * connection, const gchar * sender_n
start_service_again(INDICATOR_SERVICE_MANAGER(user_data));
} else {
+ /* If we weren't connected before, we are now. Let's tell the
+ world! */
if (!priv->connected) {
priv->connected = TRUE;
g_signal_emit(G_OBJECT(user_data), signals[CONNECTION_CHANGE], 0, TRUE, TRUE);
}
+
+ /* If the names are both valid, and they're not the same, it means that
+ we've actually changed. So we need to tell the new guy that we're
+ watching them */
+ if (new_name != NULL && prev_name != NULL && new_name[0] != 0 && prev_name != 0 && g_strcmp0(prev_name, new_name) != 0) {
+ /* Send watch */
+ g_dbus_proxy_call(priv->service_proxy,
+ "Watch",
+ NULL, /* params */
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ priv->watch_cancel,
+ watch_cb,
+ user_data);
+ }
}
return;