diff options
author | Ken VanDine <ken.vandine@canonical.com> | 2010-07-09 16:47:26 -0400 |
---|---|---|
committer | Ken VanDine <ken.vandine@canonical.com> | 2010-07-09 16:47:26 -0400 |
commit | b52f07039fdf21d25fb1724c47a34a66c4981798 (patch) | |
tree | 0314066c4f5b3177ba896b005bbb1062cbd5c052 /libindicator | |
parent | dc60b532b6e3f8135a6a32ac517c282fff274db5 (diff) | |
parent | c7eee08171b40c224564a5fffd3a4c5f0e32f7c9 (diff) | |
download | libayatana-indicator-b52f07039fdf21d25fb1724c47a34a66c4981798.tar.gz libayatana-indicator-b52f07039fdf21d25fb1724c47a34a66c4981798.tar.bz2 libayatana-indicator-b52f07039fdf21d25fb1724c47a34a66c4981798.zip |
releasing version 0.3.9-0ubuntu20.3.9-0ubuntu2
Diffstat (limited to 'libindicator')
-rw-r--r-- | libindicator/indicator-service.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/libindicator/indicator-service.c b/libindicator/indicator-service.c index db234e2..55fb650 100644 --- a/libindicator/indicator-service.c +++ b/libindicator/indicator-service.c @@ -395,15 +395,38 @@ try_and_get_name (IndicatorService * service) return; } +typedef struct _hash_table_find_t hash_table_find_t; +struct _hash_table_find_t { + GObject * proxy; + gchar * name; +}; + +/* 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) +{ + hash_table_find_t * finddata = (hash_table_find_t *)user_data; + if (value == finddata->proxy) { + finddata->name = key; + 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)); - unwatch_core(INDICATOR_SERVICE(user_data), name); + hash_table_find_t finddata = {0}; + finddata.proxy = proxy; + + g_hash_table_find(priv->watchers, hash_table_find, &finddata); + unwatch_core(INDICATOR_SERVICE(user_data), finddata.name); return; } @@ -466,6 +489,9 @@ _indicator_service_server_un_watch (IndicatorService * service, DBusGMethodInvoc static void unwatch_core (IndicatorService * service, const gchar * name) { + g_return_if_fail(name != NULL); + g_return_if_fail(INDICATOR_IS_SERVICE(service)); + IndicatorServicePrivate * priv = INDICATOR_SERVICE_GET_PRIVATE(service); /* Remove us from the watcher list here */ |