diff options
author | Ted Gould <ted@gould.cx> | 2013-08-15 14:29:00 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2013-08-15 14:29:00 -0500 |
commit | 5ca1b7a06fe94cb7e2d760d9a5a98de022e5376b (patch) | |
tree | db1c52702add32d4183227e6be93961a3746b210 /src | |
parent | 02ba00aad4d9755c96b5706301af60e73eb3786a (diff) | |
download | ayatana-indicator-messages-5ca1b7a06fe94cb7e2d760d9a5a98de022e5376b.tar.gz ayatana-indicator-messages-5ca1b7a06fe94cb7e2d760d9a5a98de022e5376b.tar.bz2 ayatana-indicator-messages-5ca1b7a06fe94cb7e2d760d9a5a98de022e5376b.zip |
Tracking application status
Diffstat (limited to 'src')
-rw-r--r-- | src/im-application-list.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/im-application-list.c b/src/im-application-list.c index 810886a..d9b3e2f 100644 --- a/src/im-application-list.c +++ b/src/im-application-list.c @@ -36,6 +36,8 @@ struct _ImApplicationList GSimpleActionGroup * globalactions; GSimpleAction * statusaction; + + GHashTable *app_status; }; G_DEFINE_TYPE (ImApplicationList, im_application_list, G_TYPE_OBJECT); @@ -295,6 +297,7 @@ im_application_list_dispose (GObject *object) g_clear_object (&list->statusaction); g_clear_object (&list->globalactions); + g_clear_pointer (&list->app_status, g_hash_table_unref); g_clear_pointer (&list->applications, g_hash_table_unref); g_clear_object (&list->muxer); @@ -423,6 +426,7 @@ im_application_list_init (ImApplicationList *list) }; list->applications = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, application_free); + list->app_status = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); list->globalactions = g_simple_action_group_new (); g_simple_action_group_add_entries (list->globalactions, action_entries, G_N_ELEMENTS (action_entries), list); @@ -988,7 +992,11 @@ im_application_list_get_application (ImApplicationList *list, void im_application_list_set_status (ImApplicationList * list, const gchar * id, const gchar *status) { + g_return_if_fail (IM_IS_APPLICATION_LIST (list)); + + g_hash_table_insert(list->app_status, im_application_list_canonical_id(id), g_strdup(status)); + /* TODO: Update status */ return; } |