From 1dc8a8af930e8802cb578673da6bde792619b9c8 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 6 Nov 2009 13:32:21 -0600 Subject: Making for a list of applications that we can build and destroy at will. --- src/indicator-custom.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/indicator-custom.c b/src/indicator-custom.c index 669bafd..d520948 100644 --- a/src/indicator-custom.c +++ b/src/indicator-custom.c @@ -44,12 +44,17 @@ INDICATOR_SET_TYPE(INDICATOR_CUSTOM_TYPE) #endif typedef struct _IndicatorCustomPrivate IndicatorCustomPrivate; - -struct _IndicatorCustomPrivate -{ +struct _IndicatorCustomPrivate { IndicatorServiceManager * sm; DBusGConnection * bus; DBusGProxy * service_proxy; + GList * applications; +}; + +typedef struct _ApplicationEntry ApplicationEntry; +struct _ApplicationEntry { + guint position; + IndicatorObjectEntry entry; }; #define INDICATOR_CUSTOM_GET_PRIVATE(o) \ @@ -96,6 +101,7 @@ indicator_custom_init (IndicatorCustom *self) priv->sm = indicator_service_manager_new(INDICATOR_CUSTOM_DBUS_ADDR); g_signal_connect(G_OBJECT(priv->sm), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, G_CALLBACK(connected), self); + priv->applications = NULL; return; } @@ -105,6 +111,12 @@ indicator_custom_dispose (GObject *object) { IndicatorCustomPrivate * priv = INDICATOR_CUSTOM_GET_PRIVATE(object); + while (priv->applications != NULL) { + application_removed(priv->service_proxy, + ((ApplicationEntry *)priv->applications->data)->position, + INDICATOR_CUSTOM(object)); + } + if (priv->sm != NULL) { g_object_unref(priv->sm); priv->sm = NULL; -- cgit v1.2.3