Mercurial > hg
changeset 2293:038b864b44c6
Use g_hash_table_get_keys() because glib >=2.14 should be available everywhere
author | franky |
---|---|
date | Tue, 01 Nov 2016 21:42:40 +0100 |
parents | f181418db215 |
children | 2a9569fd7644 |
files | mcabber/mcabber/roster.c |
diffstat | 1 files changed, 1 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/mcabber/mcabber/roster.c Tue Nov 01 18:00:39 2016 +0100 +++ b/mcabber/mcabber/roster.c Tue Nov 01 21:42:40 2016 +0100 @@ -1762,29 +1762,16 @@ return g_hash_table_remove(unread_jids, jid); } -// Helper function for unread_jid_get_list() -static void add_to_unreadjids(gpointer key, gpointer value, gpointer udata) -{ - GList **listp = udata; - *listp = g_list_append(*listp, key); -} - // unread_jid_get_list() // Return the JID list. // The content of the list should not be modified or freed. // The caller should call g_list_free() after use. GList *unread_jid_get_list(void) { - GList *list = NULL; - if (!unread_jids) return NULL; - // g_hash_table_get_keys() is only in glib >= 2.14 - //return g_hash_table_get_keys(unread_jids); - - g_hash_table_foreach(unread_jids, add_to_unreadjids, &list); - return list; + return g_hash_table_get_keys(unread_jids); } /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */