aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-04-13 14:15:01 -0500
committerTed Gould <ted@canonical.com>2009-04-13 14:15:01 -0500
commitdec69be399365590e8bc5140f470aafd805ff17d (patch)
tree0e472e469751d35ac8f03da2bc01084d75699553
parent24e268d166ef026a3f1c4e7b09ae13d15bf427eb (diff)
downloadlibayatana-indicator-dec69be399365590e8bc5140f470aafd805ff17d.tar.gz
libayatana-indicator-dec69be399365590e8bc5140f470aafd805ff17d.tar.bz2
libayatana-indicator-dec69be399365590e8bc5140f470aafd805ff17d.zip
Okay, connected into that other there code... let's see what happens.
-rw-r--r--libindicate/listener.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/libindicate/listener.c b/libindicate/listener.c
index 420d8cd..fd35d66 100644
--- a/libindicate/listener.c
+++ b/libindicate/listener.c
@@ -133,6 +133,7 @@ static void proxy_indicator_modified (DBusGProxy * proxy, guint id, const gchar
static void proxy_get_indicator_list (DBusGProxy * proxy, GArray * indicators, GError * error, gpointer data);
static void proxy_get_indicator_type (DBusGProxy * proxy, gchar * type, GError * error, gpointer data);
static void proxy_indicators_free (gpointer data);
+static void introspect_this (DBusGProxy * proxy, char * OUT_data, GError * error, gpointer data);
/* DBus interface */
gboolean _indicate_listener_get_indicator_servers (IndicateListener * listener, GList * servers);
@@ -502,13 +503,9 @@ todo_idle (gpointer data)
priv->proxies_possible = g_list_prepend(priv->proxies_possible, proxyt);
- /* I think that we need to have this as there is a race
- * condition here. If someone comes on the bus and we get
- * that message, but before we set up the handler for the ServerShow
- * signal it gets sent, we wouldn't get it. So then we would
- * miss an indicator server coming on the bus. I'd like to not
- * generate a warning in every app with DBus though. */
- indicate_listener_server_get_type(listener, &proxyt->server, get_type_cb, proxyt);
+ /* Look through the introspection data to see if this
+ is already a server */
+ introspect_this (NULL, NULL, NULL, proxyt);
return TRUE;
}
@@ -1123,6 +1120,13 @@ introspect_this (DBusGProxy * proxy, char * OUT_data, GError * error, gpointer d
/* Ah, nothing we're interested in */
return;
}
+
+ if (_introspector_path[server->introspect_level] == NULL) {
+ /* If we've found the interface at the end of the tree, whoo! hoo! */
+ /* Now we know it's safe to get the type on it */
+ indicate_listener_server_get_type(server->listener, &server->server, get_type_cb, server);
+ return;
+ }
} else {
server->introspect_level = 0;
}