diff options
author | Ted Gould <ted@gould.cx> | 2010-07-06 10:39:12 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-07-06 10:39:12 -0500 |
commit | 632c3f997f091be8daeedcd0eaf7f1043dca5530 (patch) | |
tree | a473af31e829a72bcba3215dfbae984377e53aec /libindicator | |
parent | 8a1255676ed6c7091e9c1c2dfda183dacf00ab31 (diff) | |
download | libayatana-indicator-632c3f997f091be8daeedcd0eaf7f1043dca5530.tar.gz libayatana-indicator-632c3f997f091be8daeedcd0eaf7f1043dca5530.tar.bz2 libayatana-indicator-632c3f997f091be8daeedcd0eaf7f1043dca5530.zip |
Making ths bus tracked in the private structure
Diffstat (limited to 'libindicator')
-rw-r--r-- | libindicator/indicator-service.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libindicator/indicator-service.c b/libindicator/indicator-service.c index 74b5a2e..d3e873b 100644 --- a/libindicator/indicator-service.c +++ b/libindicator/indicator-service.c @@ -50,6 +50,7 @@ typedef struct _IndicatorServicePrivate IndicatorServicePrivate; struct _IndicatorServicePrivate { gchar * name; DBusGProxy * dbus_proxy; + DBusGConnection * bus; guint timeout; GHashTable * watchers; guint this_service_version; @@ -158,13 +159,14 @@ indicator_service_init (IndicatorService *self) priv->dbus_proxy = NULL; priv->timeout = 0; priv->watchers = NULL; + priv->bus = NULL; priv->this_service_version = 0; priv->watchers = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_object_unref); /* Start talkin' dbus */ GError * error = NULL; - DBusGConnection * bus = dbus_g_bus_get(DBUS_BUS_STARTER, &error); + priv->bus = dbus_g_bus_get(DBUS_BUS_STARTER, &error); if (error != NULL) { g_error("Unable to get starter bus: %s", error->message); g_error_free(error); @@ -173,7 +175,7 @@ indicator_service_init (IndicatorService *self) /* I think this should automatically, but I can't find confirmation of that, so we're putting the extra little code in here. */ error = NULL; - bus = dbus_g_bus_get(DBUS_BUS_SESSION, &error); + priv->bus = dbus_g_bus_get(DBUS_BUS_SESSION, &error); if (error != NULL) { g_error("Unable to get session bus: %s", error->message); g_error_free(error); @@ -181,7 +183,7 @@ indicator_service_init (IndicatorService *self) } } - priv->dbus_proxy = dbus_g_proxy_new_for_name_owner(bus, + priv->dbus_proxy = dbus_g_proxy_new_for_name_owner(priv->bus, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS, @@ -192,7 +194,7 @@ indicator_service_init (IndicatorService *self) return; } - dbus_g_connection_register_g_object(bus, + dbus_g_connection_register_g_object(priv->bus, INDICATOR_SERVICE_OBJECT, G_OBJECT(self)); |