diff options
author | Ted Gould <ted@gould.cx> | 2010-02-06 11:17:05 -0800 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-02-06 11:17:05 -0800 |
commit | 85b920fe3b8c51bc5b2e3c1bbd7b6e62cd3b471e (patch) | |
tree | 114f7fc306e45b1867ac4e37462d0be67ad4ecb6 /src | |
parent | 244021467be1258f89feebcaf76570d1175c253d (diff) | |
download | libayatana-appindicator-85b920fe3b8c51bc5b2e3c1bbd7b6e62cd3b471e.tar.gz libayatana-appindicator-85b920fe3b8c51bc5b2e3c1bbd7b6e62cd3b471e.tar.bz2 libayatana-appindicator-85b920fe3b8c51bc5b2e3c1bbd7b6e62cd3b471e.zip |
Now we're actively killing.
Diffstat (limited to 'src')
-rw-r--r-- | src/indicator-application.c | 19 |
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. */ |