diff console/gntblist.c @ 14847:d478f3853671

[gaim-migrate @ 17616] Fix bug #1582629. The terminal should now always go back to normal state after quitting from gaim-text. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 29 Oct 2006 03:43:15 +0000
parents c7651586e27b
children 6d9db29f4c10
line wrap: on
line diff
--- a/console/gntblist.c	Sun Oct 29 01:32:04 2006 +0000
+++ b/console/gntblist.c	Sun Oct 29 03:43:15 2006 +0000
@@ -101,6 +101,7 @@
 static void remove_peripherals(GGBlist *ggblist);
 static const char * get_display_name(GaimBlistNode *node);
 static void savedstatus_changed(GaimSavedStatus *now, GaimSavedStatus *old);
+static void blist_show(GaimBuddyList *list);
 
 /* Sort functions */
 static int blist_node_compare_text(GaimBlistNode *n1, GaimBlistNode *n2);
@@ -228,6 +229,11 @@
 static void
 new_list(GaimBuddyList *list)
 {
+	if (ggblist)
+		return;
+
+	ggblist = g_new0(GGBlist, 1);
+	list->ui_data = ggblist;
 }
 
 static void
@@ -398,7 +404,7 @@
 {
 	new_list,
 	new_node,
-	NULL,
+	blist_show,
 	node_update,
 	node_remove,
 	NULL,
@@ -1470,8 +1476,6 @@
 	gaim_prefs_add_bool(PREF_ROOT "/showoffline", FALSE);
 	gaim_prefs_add_string(PREF_ROOT "/sort_type", "text");
 
-	gg_blist_show();
-
 	gaim_prefs_connect_callback(gg_blist_get_handle(),
 			PREF_ROOT "/showoffline", redraw_blist, NULL);
 	gaim_prefs_connect_callback(gg_blist_get_handle(),
@@ -1851,12 +1855,16 @@
 
 void gg_blist_show()
 {
-	if (ggblist)
-		return;
+	blist_show(gaim_get_blist());
+}
 
-	ggblist = g_new0(GGBlist, 1);
-
-	gaim_get_blist()->ui_data = ggblist;
+static void
+blist_show(GaimBuddyList *list)
+{
+	if (ggblist == NULL)
+		new_list(list);
+	else if (ggblist->window)
+		return;
 
 	ggblist->window = gnt_vwindow_new(FALSE);
 	gnt_widget_set_name(ggblist->window, "buddylist");