changeset 27612:b419196556c7

corner case: the first group wasn't being put into the hash table.
author Paul Aurich <paul@darkrain42.org>
date Sat, 18 Jul 2009 18:32:47 +0000
parents d6377ec7bcd8
children 5f17bfa9dc70
files libpurple/blist.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/blist.c	Sat Jul 18 16:17:32 2009 +0000
+++ b/libpurple/blist.c	Sat Jul 18 18:32:47 2009 +0000
@@ -1971,6 +1971,9 @@
 
 	if (!purplebuddylist->root) {
 		purplebuddylist->root = gnode;
+
+		key = g_utf8_collate_key(group->name, -1);
+		g_hash_table_insert(groups_cache, key, group);
 		return;
 	}
 
@@ -1990,6 +1993,9 @@
 			gnode->prev->next = gnode->next;
 		if (gnode->next)
 			gnode->next->prev = gnode->prev;
+	} else {
+		key = g_utf8_collate_key(group->name, -1);
+		g_hash_table_insert(groups_cache, key, group);
 	}
 
 	if (node && PURPLE_BLIST_NODE_IS_GROUP(node)) {
@@ -2006,9 +2012,6 @@
 		purplebuddylist->root = gnode;
 	}
 
-	key = g_utf8_collate_key(group->name, -1);
-	g_hash_table_insert(groups_cache, key, group);
-
 	purple_blist_schedule_save();
 
 	if (ops && ops->update) {