aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-application.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-02-06 11:17:05 -0800
committerTed Gould <ted@gould.cx>2010-02-06 11:17:05 -0800
commit85b920fe3b8c51bc5b2e3c1bbd7b6e62cd3b471e (patch)
tree114f7fc306e45b1867ac4e37462d0be67ad4ecb6 /src/indicator-application.c
parent244021467be1258f89feebcaf76570d1175c253d (diff)
downloadlibayatana-appindicator-85b920fe3b8c51bc5b2e3c1bbd7b6e62cd3b471e.tar.gz
libayatana-appindicator-85b920fe3b8c51bc5b2e3c1bbd7b6e62cd3b471e.tar.bz2
libayatana-appindicator-85b920fe3b8c51bc5b2e3c1bbd7b6e62cd3b471e.zip
Now we're actively killing.
Diffstat (limited to 'src/indicator-application.c')
-rw-r--r--src/indicator-application.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/indicator-application.c b/src/indicator-application.c
index 2276dda..07e6b86 100644
--- a/src/indicator-application.c
+++ b/src/indicator-application.c
@@ -102,6 +102,7 @@ static void connected (IndicatorApplication * application);
static void disconnected (IndicatorApplication * application);
static void disconnected_helper (gpointer data, gpointer user_data);
static gboolean disconnected_kill (gpointer user_data);
+static void disconnected_kill_helper (gpointer data, gpointer user_data);
static void application_added (DBusGProxy * proxy, const gchar * iconname, gint position, const gchar * dbusaddress, const gchar * dbusobject, const gchar * icon_path, IndicatorApplication * application);
static void application_removed (DBusGProxy * proxy, gint position , IndicatorApplication * application);
static void application_icon_changed (DBusGProxy * proxy, gint position, const gchar * iconname, IndicatorApplication * application);
@@ -325,7 +326,8 @@ disconnected (IndicatorApplication * application)
static void
disconnected_helper (gpointer data, gpointer user_data)
{
-
+ ApplicationEntry * entry = (ApplicationEntry *)data;
+ entry->old_service = TRUE;
return;
}
@@ -336,10 +338,23 @@ disconnected_kill (gpointer user_data)
{
IndicatorApplicationPrivate * priv = INDICATOR_APPLICATION_GET_PRIVATE(user_data);
priv->disconnect_kill = 0;
-
+ g_list_foreach(priv->applications, disconnected_kill_helper, NULL);
return FALSE;
}
+/* Looks for entries that are still associated with the
+ old service and removes them. */
+static void
+disconnected_kill_helper (gpointer data, gpointer user_data)
+{
+ IndicatorApplicationPrivate * priv = INDICATOR_APPLICATION_GET_PRIVATE(user_data);
+ ApplicationEntry * entry = (ApplicationEntry *)data;
+ if (entry->old_service) {
+ application_removed(NULL, g_list_index(priv->applications, data), INDICATOR_APPLICATION(user_data));
+ }
+ return;
+}
+
/* Goes through the list of applications that we're maintaining and
pulls out the IndicatorObjectEntry and returns that in a list
for the caller. */