diff options
author | Ted Gould <ted@gould.cx> | 2010-07-09 09:53:20 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-07-09 09:53:20 -0500 |
commit | 74a24d7651432fb151cddb024a562bdb71aaee57 (patch) | |
tree | cfcb8cb7a76e16af4e3ad3d8d0d9c473aa44f6ad | |
parent | dac4891e4e3c809ccc3ac08f0d7e317962808792 (diff) | |
download | libayatana-indicator-74a24d7651432fb151cddb024a562bdb71aaee57.tar.gz libayatana-indicator-74a24d7651432fb151cddb024a562bdb71aaee57.tar.bz2 libayatana-indicator-74a24d7651432fb151cddb024a562bdb71aaee57.zip |
Stop asking for the name, instead let's find it on our own.
-rw-r--r-- | libindicator/indicator-service.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libindicator/indicator-service.c b/libindicator/indicator-service.c index fc35a03..d0f8ed2 100644 --- a/libindicator/indicator-service.c +++ b/libindicator/indicator-service.c @@ -395,14 +395,26 @@ try_and_get_name (IndicatorService * service) return; } +/* Look in the hash table for the proxy, as it won't give us + its name. */ +static gboolean +hash_table_find (gpointer key, gpointer value, gpointer user_data) +{ + if (value == user_data) { + return TRUE; + } + return FALSE; +} + /* If the proxy gets destroyed that's the same as getting an unwatch signal. Make it so. */ static void proxy_destroyed (GObject * proxy, gpointer user_data) { g_return_if_fail(INDICATOR_IS_SERVICE(user_data)); + IndicatorServicePrivate * priv = INDICATOR_SERVICE_GET_PRIVATE(user_data); - const gchar * name = dbus_g_proxy_get_bus_name(DBUS_G_PROXY(proxy)); + gchar * name = (gchar *)g_hash_table_find(priv->watchers, hash_table_find, proxy); unwatch_core(INDICATOR_SERVICE(user_data), name); return; |