aboutsummaryrefslogtreecommitdiff
path: root/libindicate
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-01-29 13:03:47 -0600
committerTed Gould <ted@canonical.com>2009-01-29 13:03:47 -0600
commitfab825e1be63aad79b068f642b40de41d85f772b (patch)
tree87d0e1638210671c3f4c380c2e65d1684488fc17 /libindicate
parent054c9ba7a947c88735e83e5207e5d9d1f052d3a4 (diff)
downloadlibayatana-indicator-fab825e1be63aad79b068f642b40de41d85f772b.tar.gz
libayatana-indicator-fab825e1be63aad79b068f642b40de41d85f772b.tar.bz2
libayatana-indicator-fab825e1be63aad79b068f642b40de41d85f772b.zip
Wow, I didn't realize we weren't handling properties at all correctly. Fixed now. Whew.
Diffstat (limited to 'libindicate')
-rw-r--r--libindicate/listener.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/libindicate/listener.c b/libindicate/listener.c
index ef0b79d..31fdf4b 100644
--- a/libindicate/listener.c
+++ b/libindicate/listener.c
@@ -504,26 +504,34 @@ proxy_indicator_removed (DBusGProxy * proxy, guint id, const gchar * type, proxy
}
static void
-proxy_indicator_modified (DBusGProxy * proxy, guint id, const gchar * type, proxy_t * proxyt)
+proxy_indicator_modified (DBusGProxy * proxy, guint id, const gchar * property, proxy_t * proxyt)
{
if (proxyt->indicators == NULL) {
g_warning("Oddly we had an indicator modified from an interface that we didn't think had indicators.");
return;
}
- // TODO: Search for the ID to discover the type
- GHashTable * indicators = g_hash_table_lookup(proxyt->indicators, type);
- if (indicators == NULL) {
- g_warning("Can not modify indicator %d of type '%s' as there are no indicators of that type on %s.", id, type, proxyt->name);
- return;
+ GList * keys = g_hash_table_get_keys(proxyt->indicators);
+ GList * inc = NULL;
+ gchar * type;
+
+ for (inc = g_list_first(keys); inc != NULL; inc = g_list_next(inc)) {
+ type = (gchar *)inc->data;
+
+ GHashTable * indicators = g_hash_table_lookup(proxyt->indicators, type);
+ if (indicators == NULL) continue; /* no indicators for this type? Odd, but not an error */
+
+ if (g_hash_table_lookup(indicators, (gpointer)id)) {
+ break;
+ }
}
- if (!g_hash_table_lookup(indicators, (gpointer)id)) {
- g_warning("No indicator %d of type '%s' on '%s'.", id, type, proxyt->name);
+ if (inc == NULL) {
+ g_warning("Can not modify indicator %d with property '%s' as there are no indicators with that id on %s.", id, property, proxyt->name);
return;
}
- g_signal_emit(proxyt->listener, signals[INDICATOR_MODIFIED], 0, proxyt->name, id, type, type, TRUE);
+ g_signal_emit(proxyt->listener, signals[INDICATOR_MODIFIED], 0, proxyt->name, id, type, property, TRUE);
return;
}