aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-07-12 14:35:40 -0500
committerTed Gould <ted@gould.cx>2011-07-12 14:35:40 -0500
commit45d7404d935971df085f81906ae8463f88aa79b0 (patch)
treed2881f58e649fc63902911011e6cf779ebdc372b
parentaad536423709ebbf17a728c3422b83b6f253914b (diff)
parent2e66ca5c013f2f37fc274c9d02b714fe6d21928e (diff)
downloadlibayatana-indicator-45d7404d935971df085f81906ae8463f88aa79b0.tar.gz
libayatana-indicator-45d7404d935971df085f81906ae8463f88aa79b0.tar.bz2
libayatana-indicator-45d7404d935971df085f81906ae8463f88aa79b0.zip
* Upstream Merge
* Watching new services when the name switches
-rw-r--r--debian/changelog7
-rw-r--r--libindicator/indicator-service-manager.c22
2 files changed, 27 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog
index 8a50617..0ec7300 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+libindicator (0.3.90-0ubuntu2~ppa2) UNRELEASED; urgency=low
+
+ * Upstream Merge
+ * Watching new services when the name switches
+
+ -- Ted Gould <ted@ubuntu.com> Tue, 12 Jul 2011 14:35:18 -0500
+
libindicator (0.3.90-0ubuntu2~ppa1) oneiric; urgency=low
* Upstream Merge
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;