changeset 13195:c242836ff793

[gaim-migrate @ 15558] sf patch #1421206, from Sadrul Habib Chowdhury Fix a crash when renaming a group to an already existing group name (sf bug #1421118) committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 09 Feb 2006 00:10:12 +0000
parents 7099a443131d
children f04dffe22957
files src/blist.c src/gtkblist.c
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/blist.c	Thu Feb 09 00:00:08 2006 +0000
+++ b/src/blist.c	Thu Feb 09 00:10:12 2006 +0000
@@ -994,6 +994,7 @@
 		/* Make a copy of the old group name and then delete the old group */
 		old_name = g_strdup(source->name);
 		gaim_blist_remove_group(source);
+		source = dest;
 	} else {
 		/* A simple rename */
 		GaimBlistNode *cnode, *bnode;
@@ -1007,7 +1008,6 @@
 
 		old_name = source->name;
 		source->name = g_strdup(new_name);
-
 	}
 
 	/* Save our changes */
@@ -1018,6 +1018,7 @@
 		ops->update(gaimbuddylist, (GaimBlistNode*)source);
 
 	/* Notify all PRPLs */
+	/* TODO: Is this condition needed?  Seems like it would always be TRUE */
 	if(old_name && source && strcmp(source->name, old_name)) {
 		for (accts = gaim_group_get_accounts(source); accts; accts = g_slist_remove(accts, accts->data)) {
 			GaimAccount *account = accts->data;
--- a/src/gtkblist.c	Thu Feb 09 00:00:08 2006 +0000
+++ b/src/gtkblist.c	Thu Feb 09 00:10:12 2006 +0000
@@ -4022,7 +4022,7 @@
 		count = gaim_blist_get_group_size(group, FALSE);
 	else
 		count = gaim_blist_get_group_online_count(group);
-	
+
 	if (count > 0 || gaim_prefs_get_bool("/gaim/gtk/blist/show_empty_groups"))
 		show = TRUE;
 	else {
@@ -4033,7 +4033,7 @@
 				if (buddy_is_displayable((GaimBuddy*)n)) {
 					show = TRUE;
 					break;
-				}					
+				}
 			}
 			n = gaim_blist_node_next(n, FALSE);
 		}
@@ -4257,6 +4257,9 @@
 	if(!gtkblist || !node)
 		return;
 
+	if (node->ui_data == NULL)
+		gaim_gtk_blist_new_node(node);
+
 	switch(node->type) {
 		case GAIM_BLIST_GROUP_NODE:
 			gaim_gtk_blist_update_group(list, node);