diff options
author | Ted Gould <ted@gould.cx> | 2013-08-15 16:13:49 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2013-08-15 16:13:49 -0500 |
commit | 922fb55f693e3ac2523414a150b667bd0236138a (patch) | |
tree | e193838fe0ae41b078bab6960eb1d8f25a7cbc84 | |
parent | 04aad431b226943042233a11aa98e30b9e82c820 (diff) | |
download | ayatana-indicator-messages-922fb55f693e3ac2523414a150b667bd0236138a.tar.gz ayatana-indicator-messages-922fb55f693e3ac2523414a150b667bd0236138a.tar.bz2 ayatana-indicator-messages-922fb55f693e3ac2523414a150b667bd0236138a.zip |
Couldn't make that assumption, instead assume they're all listening and adjust themselves or tell us otherwise
-rw-r--r-- | src/im-application-list.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/im-application-list.c b/src/im-application-list.c index b23923a..aaa1c38 100644 --- a/src/im-application-list.c +++ b/src/im-application-list.c @@ -1012,15 +1012,21 @@ status_activated (GSimpleAction * action, GVariant * param, gpointer user_data) { g_return_if_fail (IM_IS_APPLICATION_LIST(user_data)); ImApplicationList * list = IM_APPLICATION_LIST(user_data); + const gchar * status = g_variant_get_string(param, NULL); g_simple_action_set_state(action, param); - /* We assume all the applications are now seeing our status - and updating. We don't need to track their status until - they tell us different. */ - g_hash_table_remove_all(list->app_status); + GList * appshash = g_hash_table_get_keys(list->app_status); + GList * appsfree = g_list_copy_deep(appshash, (GCopyFunc)g_strdup, NULL); + GList * app; + + for (app = appsfree; app != NULL; app = g_list_next(app)) { + g_hash_table_insert(list->app_status, app->data, g_strdup(status)); + } + + g_list_free(appshash); + g_list_free(appsfree); - const gchar * status = g_variant_get_string(param, NULL); g_signal_emit (list, signals[STATUS_SET], 0, status); return; @@ -1054,16 +1060,8 @@ im_application_list_set_status (ImApplicationList * list, const gchar * id, cons g_hash_table_insert(list->app_status, im_application_list_canonical_id(id), g_strdup(status)); - GVariant * action_state = NULL; - g_object_get(list->statusaction, "state", &action_state, NULL); - guint final_status = STATUS_ID_OFFLINE; - if (action_state != NULL) { - final_status = status2val(g_variant_get_string(action_state, NULL)); - g_variant_unref(action_state); - } - GList * statuses = g_hash_table_get_values(list->app_status); GList * statusentry; |