pidgin: f0bb331b: corner case: the first group wasn't bein...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Sat Jul 18 14:35:34 EDT 2009


-----------------------------------------------------------------
Revision: f0bb331be0eb9eb81e5741fefb0dc7ce45a1d4a3
Ancestor: d3334a023251e5d640dc061092a6aa2fbd14e629
Author: darkrain42 at pidgin.im
Date: 2009-07-18T18:32:47
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/f0bb331be0eb9eb81e5741fefb0dc7ce45a1d4a3

Modified files:
        libpurple/blist.c

ChangeLog: 

corner case: the first group wasn't being put into the hash table.

-------------- next part --------------
============================================================
--- libpurple/blist.c	0b359b0654019c09bafa13d9c75f326e7eca2aba
+++ libpurple/blist.c	ceedbdb2169a6c5f028a7343f86a708f8860531d
@@ -1971,6 +1971,9 @@ void purple_blist_add_group(PurpleGroup 
 
 	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 @@ void purple_blist_add_group(PurpleGroup 
 			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 @@ void purple_blist_add_group(PurpleGroup 
 		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) {


More information about the Commits mailing list