From fb5b3301a2b7dcb9239c1c19a6134e2999e04007 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 15 Jan 2009 20:10:38 -0600 Subject: Now correctly calling the get indicators function to get the indicators on already created objects. --- libindicate/listener.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/libindicate/listener.c b/libindicate/listener.c index a26ddcc..1087945 100644 --- a/libindicate/listener.c +++ b/libindicate/listener.c @@ -42,6 +42,7 @@ static void build_todo_list_cb (DBusGProxy * proxy, char ** names, GError * erro static void todo_list_add (const gchar * name, DBusGProxy * proxy, IndicateListener * listener); static gboolean todo_idle (gpointer data); static void proxy_indicator_added (DBusGProxy * proxy, guint id, const gchar * type, proxy_t * proxyt); +static void proxy_get_indicator_list (DBusGProxy * proxy, GArray * indicators, GError * error, gpointer data); /* Code */ static void @@ -296,9 +297,27 @@ todo_idle (gpointer data) dbus_g_proxy_connect_signal(proxyt->proxy, "IndicatorAdded", G_CALLBACK(proxy_indicator_added), proxyt, NULL); + org_freedesktop_indicator_get_indicator_list_async(proxyt->proxy, proxy_get_indicator_list, proxyt); return TRUE; } +static void +proxy_get_indicator_list (DBusGProxy * proxy, GArray * indicators, GError * error, gpointer data) +{ + if (error != NULL) { + return; + } + + proxy_t * proxyt = (proxy_t *)data; + + int i; + for (i = 0; i < indicators->len; i++) { + g_debug("Interface %s has an indicator %d", proxyt->name, g_array_index(indicators, guint, i)); + } + + return; +} + static void proxy_indicator_added (DBusGProxy * proxy, guint id, const gchar * type, proxy_t * proxyt) { -- cgit v1.2.3