From fced2aaae755846922b46fa55a6444f0e0406c8d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 12 Mar 2010 15:08:25 -0600 Subject: Building us a proxy! Now we are dangerous. --- src/indicator-session.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/indicator-session.c b/src/indicator-session.c index a815e40..0b8d77e 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -55,6 +55,7 @@ struct _IndicatorSession { IndicatorServiceManager * service; GtkImage * status_image; DbusmenuGtkMenu * menu; + DBusGProxy * service_proxy; }; GType indicator_session_get_type (void); @@ -109,6 +110,12 @@ indicator_session_init (IndicatorSession *self) dbusmenu_client_add_type_handler(client, MENU_SWITCH_TYPE, build_menu_switch); dbusmenu_client_add_type_handler(client, USER_ITEM_TYPE, new_user_item); + DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); + self->service_proxy = dbus_g_proxy_new_for_name(session_bus, + INDICATOR_SESSION_DBUS_NAME, + INDICATOR_SESSION_SERVICE_DBUS_OBJECT, + INDICATOR_SESSION_SERVICE_DBUS_IFACE); + return; } @@ -122,6 +129,11 @@ indicator_session_dispose (GObject *object) self->service = NULL; } + if (self->service_proxy != NULL) { + g_object_unref(self->service_proxy); + self->service_proxy = NULL; + } + G_OBJECT_CLASS (indicator_session_parent_class)->dispose (object); return; } -- cgit v1.2.3