diff options
author | Ted Gould <ted@gould.cx> | 2010-07-06 10:47:58 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-07-06 10:47:58 -0500 |
commit | d23ca44c07ddf691ae41b4a6c5c10b794f1de765 (patch) | |
tree | 7f321b74b121110c1be588580a5a4ea6cda616a4 /libindicator/indicator-service.c | |
parent | 632c3f997f091be8daeedcd0eaf7f1043dca5530 (diff) | |
download | libayatana-indicator-d23ca44c07ddf691ae41b4a6c5c10b794f1de765.tar.gz libayatana-indicator-d23ca44c07ddf691ae41b4a6c5c10b794f1de765.tar.bz2 libayatana-indicator-d23ca44c07ddf691ae41b4a6c5c10b794f1de765.zip |
Actually creating a proxy to see if we can detect the watcher going away.
Diffstat (limited to 'libindicator/indicator-service.c')
-rw-r--r-- | libindicator/indicator-service.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/libindicator/indicator-service.c b/libindicator/indicator-service.c index d3e873b..01fabce 100644 --- a/libindicator/indicator-service.c +++ b/libindicator/indicator-service.c @@ -387,9 +387,19 @@ _indicator_service_server_watch (IndicatorService * service, DBusGMethodInvocati const gchar * sender = dbus_g_method_get_sender(method); if (g_hash_table_lookup(priv->watchers, sender) == NULL) { - DBusGProxy * senderproxy = (gpointer)1; - - g_hash_table_insert(priv->watchers, g_strdup(sender), senderproxy); + GError * error = NULL; + DBusGProxy * senderproxy = dbus_g_proxy_new_for_name_owner(priv->bus, + sender, + "/", + DBUS_INTERFACE_INTROSPECTABLE, + &error); + + if (error == NULL) { + g_hash_table_insert(priv->watchers, g_strdup(sender), senderproxy); + } else { + g_warning("Unable to create proxy for watcher '%s': %s", sender, error->message); + g_error_free(error); + } } if (priv->timeout != 0) { |