changeset 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 04d2e57b22c5
children 8e62cee6d738
files src/conversation.c src/gtkconv.c
diffstat 2 files changed, 9 insertions(+), 6 deletions(-) [+]
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);
 }
--- a/src/gtkconv.c	Sat Jan 25 23:20:06 2003 +0000
+++ b/src/gtkconv.c	Sun Jan 26 01:22:02 2003 +0000
@@ -3464,6 +3464,9 @@
 	gtkwin  = GAIM_GTK_WINDOW(win);
 	gtkconv = GAIM_GTK_CONVERSATION(conv);
 
+	if (new_index > gaim_conversation_get_index(conv))
+		new_index--;
+
 	gtk_notebook_reorder_child(GTK_NOTEBOOK(gtkwin->notebook),
 							   gtkconv->tab_cont, new_index);
 }