From 370c87f0cfa8364d3efd66e229772e2db94b13dc Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 10 Feb 2010 08:43:35 -0600 Subject: Moving the registration of the object to when we want to connect everything, and making the path include the item ID to ensure it's unique. --- src/libappindicator/app-indicator.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/libappindicator/app-indicator.c') diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index 540620c..fb6e7dc 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -332,11 +332,7 @@ app_indicator_init (AppIndicator *self) } dbus_g_connection_ref(priv->connection); - dbus_g_connection_register_g_object(priv->connection, - DEFAULT_ITEM_PATH, - G_OBJECT(self)); - - self->priv = priv; + self->priv = priv; return; } @@ -584,6 +580,12 @@ check_connect (AppIndicator *self) if (priv->icon_name == NULL) return; if (priv->id == NULL) return; + gchar * path = g_strdup_printf(DEFAULT_ITEM_PATH "/%s", priv->id); + dbus_g_connection_register_g_object(priv->connection, + path, + G_OBJECT(self)); + g_free(path); + GError * error = NULL; priv->watcher_proxy = dbus_g_proxy_new_for_name_owner(priv->connection, NOTIFICATION_WATCHER_DBUS_ADDR, -- cgit v1.2.3