diff src/conversation.c @ 4415:c90039137172

[gaim-migrate @ 4688] Tabs are no longer off to the right one when reordered. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 26 Jan 2003 01:22:02 +0000
parents 76223649765b
children be8f9ca74ddf
line wrap: on
line diff
--- a/src/conversation.c	Sat Jan 25 23:20:06 2003 +0000
+++ b/src/conversation.c	Sun Jan 26 01:22:02 2003 +0000
@@ -689,14 +689,14 @@
 	if (ops != NULL && ops->move_conversation != NULL)
 		ops->move_conversation(win, conv, new_index);
 
-	/* Insert it where it should go. */
-	win->conversations = g_list_insert(win->conversations, conv,
-		(new_index > index ? new_index + 1 : new_index));
+	if (new_index > index)
+		new_index--;
 
 	/* Remove the old one. */
-	l->data = NULL;
-	win->conversations = g_list_remove_link(win->conversations, l);
-	g_list_free_1(l);
+	win->conversations = g_list_delete_link(win->conversations, l);
+
+	/* Insert it where it should go. */
+	win->conversations = g_list_insert(win->conversations, conv, new_index);
 
 	update_conv_indexes(win);
 }