aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-30 09:38:30 -0500
committerTed Gould <ted@gould.cx>2010-03-30 09:38:30 -0500
commit70f017d277336642bada8ca2b2ff514105ab6ea2 (patch)
treea0d6e363df8bcccfb7394b8ef83aed321480b66f /src
parent6d6020686cd9a583a99650f1da0062ccc86584fe (diff)
downloadayatana-indicator-messages-70f017d277336642bada8ca2b2ff514105ab6ea2.tar.gz
ayatana-indicator-messages-70f017d277336642bada8ca2b2ff514105ab6ea2.tar.bz2
ayatana-indicator-messages-70f017d277336642bada8ca2b2ff514105ab6ea2.zip
Making it so that we don't build two icon_proxies ever.
Diffstat (limited to 'src')
-rw-r--r--src/indicator-messages.c42
1 files changed, 22 insertions, 20 deletions
diff --git a/src/indicator-messages.c b/src/indicator-messages.c
index 34dfb1a..48b9abf 100644
--- a/src/indicator-messages.c
+++ b/src/indicator-messages.c
@@ -226,28 +226,30 @@ connection_change (IndicatorServiceManager * sm, gboolean connected, gpointer us
return;
}
- icon_proxy = dbus_g_proxy_new_for_name(connection,
- INDICATOR_MESSAGES_DBUS_NAME,
- INDICATOR_MESSAGES_DBUS_SERVICE_OBJECT,
- INDICATOR_MESSAGES_DBUS_SERVICE_INTERFACE);
if (icon_proxy == NULL) {
- g_warning("Unable to get messages service interface.");
- return;
+ icon_proxy = dbus_g_proxy_new_for_name(connection,
+ INDICATOR_MESSAGES_DBUS_NAME,
+ INDICATOR_MESSAGES_DBUS_SERVICE_OBJECT,
+ INDICATOR_MESSAGES_DBUS_SERVICE_INTERFACE);
+ if (icon_proxy == NULL) {
+ g_warning("Unable to get messages service interface.");
+ return;
+ }
+
+ dbus_g_proxy_add_signal(icon_proxy, "AttentionChanged", G_TYPE_BOOLEAN, G_TYPE_INVALID);
+ dbus_g_proxy_connect_signal(icon_proxy,
+ "AttentionChanged",
+ G_CALLBACK(attention_changed_cb),
+ NULL,
+ NULL);
+
+ dbus_g_proxy_add_signal(icon_proxy, "IconChanged", G_TYPE_BOOLEAN, G_TYPE_INVALID);
+ dbus_g_proxy_connect_signal(icon_proxy,
+ "IconChanged",
+ G_CALLBACK(icon_changed_cb),
+ NULL,
+ NULL);
}
-
- dbus_g_proxy_add_signal(icon_proxy, "AttentionChanged", G_TYPE_BOOLEAN, G_TYPE_INVALID);
- dbus_g_proxy_connect_signal(icon_proxy,
- "AttentionChanged",
- G_CALLBACK(attention_changed_cb),
- NULL,
- NULL);
-
- dbus_g_proxy_add_signal(icon_proxy, "IconChanged", G_TYPE_BOOLEAN, G_TYPE_INVALID);
- dbus_g_proxy_connect_signal(icon_proxy,
- "IconChanged",
- G_CALLBACK(icon_changed_cb),
- NULL,
- NULL);
org_ayatana_indicator_messages_service_attention_requested_async(icon_proxy, attention_cb, NULL);
org_ayatana_indicator_messages_service_icon_shown_async(icon_proxy, icon_cb, NULL);