diff options
author | Ted Gould <ted@gould.cx> | 2010-02-06 10:56:44 -0800 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-02-06 10:56:44 -0800 |
commit | 130e93c1195cad4a74e84602e71b08786cfbd5db (patch) | |
tree | 80a0e33c6af2cbfa0e30092a7701f4e03d303835 /src/indicator-application.c | |
parent | 87a7acd9fc0069cb2f4fee96e42ee6651b35629f (diff) | |
download | ayatana-indicator-application-130e93c1195cad4a74e84602e71b08786cfbd5db.tar.gz ayatana-indicator-application-130e93c1195cad4a74e84602e71b08786cfbd5db.tar.bz2 ayatana-indicator-application-130e93c1195cad4a74e84602e71b08786cfbd5db.zip |
Changing the proxy to only build if we need it, and not destroy itself on killing the process. There's really no reason for that.
Diffstat (limited to 'src/indicator-application.c')
-rw-r--r-- | src/indicator-application.c | 88 |
1 files changed, 45 insertions, 43 deletions
diff --git a/src/indicator-application.c b/src/indicator-application.c index c7789f1..f6fe314 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -241,50 +241,52 @@ connected (IndicatorApplication * application) } } + if (priv->service_proxy) { /* Build the service proxy */ - priv->service_proxy = dbus_g_proxy_new_for_name_owner(priv->bus, - INDICATOR_APPLICATION_DBUS_ADDR, - INDICATOR_APPLICATION_DBUS_OBJ, - INDICATOR_APPLICATION_DBUS_IFACE, - &error); - - /* Set up proxy signals */ - g_debug("Setup proxy signals"); - dbus_g_proxy_add_signal(priv->service_proxy, - "ApplicationAdded", - G_TYPE_STRING, - G_TYPE_INT, - G_TYPE_STRING, - G_TYPE_STRING, - G_TYPE_STRING, - G_TYPE_INVALID); - dbus_g_proxy_add_signal(priv->service_proxy, - "ApplicationRemoved", - G_TYPE_INT, - G_TYPE_INVALID); - dbus_g_proxy_add_signal(priv->service_proxy, - "ApplicationIconChanged", - G_TYPE_INT, - G_TYPE_STRING, - G_TYPE_INVALID); - - /* Connect to them */ - g_debug("Connect to them."); - dbus_g_proxy_connect_signal(priv->service_proxy, - "ApplicationAdded", - G_CALLBACK(application_added), - application, - NULL /* Disconnection Signal */); - dbus_g_proxy_connect_signal(priv->service_proxy, - "ApplicationRemoved", - G_CALLBACK(application_removed), - application, - NULL /* Disconnection Signal */); - dbus_g_proxy_connect_signal(priv->service_proxy, - "ApplicationIconChanged", - G_CALLBACK(application_icon_changed), - application, - NULL /* Disconnection Signal */); + priv->service_proxy = dbus_g_proxy_new_for_name(priv->bus, + INDICATOR_APPLICATION_DBUS_ADDR, + INDICATOR_APPLICATION_DBUS_OBJ, + INDICATOR_APPLICATION_DBUS_IFACE, + &error); + + /* Set up proxy signals */ + g_debug("Setup proxy signals"); + dbus_g_proxy_add_signal(priv->service_proxy, + "ApplicationAdded", + G_TYPE_STRING, + G_TYPE_INT, + G_TYPE_STRING, + G_TYPE_STRING, + G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_add_signal(priv->service_proxy, + "ApplicationRemoved", + G_TYPE_INT, + G_TYPE_INVALID); + dbus_g_proxy_add_signal(priv->service_proxy, + "ApplicationIconChanged", + G_TYPE_INT, + G_TYPE_STRING, + G_TYPE_INVALID); + + /* Connect to them */ + g_debug("Connect to them."); + dbus_g_proxy_connect_signal(priv->service_proxy, + "ApplicationAdded", + G_CALLBACK(application_added), + application, + NULL /* Disconnection Signal */); + dbus_g_proxy_connect_signal(priv->service_proxy, + "ApplicationRemoved", + G_CALLBACK(application_removed), + application, + NULL /* Disconnection Signal */); + dbus_g_proxy_connect_signal(priv->service_proxy, + "ApplicationIconChanged", + G_CALLBACK(application_icon_changed), + application, + NULL /* Disconnection Signal */); + } /* Query it for existing applications */ g_debug("Request current apps"); |