changeset 7602:df5b0937ea47

[gaim-migrate @ 8225] Put back a default conversation placement function. This was causing very bad things to happen on qpe-gaim, though likely gtk-gaim was okay..? committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sat, 22 Nov 2003 21:35:25 +0000
parents 6d59800ace03
children dfebaa14bf67
files src/conversation.c
diffstat 1 files changed, 16 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/conversation.c	Sat Nov 22 19:15:32 2003 +0000
+++ b/src/conversation.c	Sat Nov 22 21:35:25 2003 +0000
@@ -51,6 +51,9 @@
 static GList *conv_placement_fncs = NULL;
 static GaimConvPlacementFunc place_conv = NULL;
 
+static void ensure_default_funcs(void);
+static void conv_placement_last_created_win(GaimConversation *conv);
+
 static gint
 insertname_compare(gconstpointer one, gconstpointer two)
 {
@@ -851,7 +854,14 @@
 		gaim_conv_window_show(win);
 	}
 	else {
-		if (!place_conv)
+		if (place_conv == NULL)
+		{
+			ensure_default_funcs();
+
+			place_conv = conv_placement_last_created_win;
+		}
+
+		if (place_conv == NULL)
 			gaim_debug(GAIM_DEBUG_ERROR, "conversation",
 					   "This is about to suck.\n");
 
@@ -2324,7 +2334,6 @@
 	GList *wins, *convs;
 	GaimAccount *account;
 
-
 	account = gaim_conversation_get_account(conv);
 	type = gaim_conversation_get_type(conv);
 
@@ -2357,7 +2366,8 @@
 	conv_placement_new_window(conv);
 }
 
-static ConvPlacementData *get_conv_placement_data(const char *id)
+static ConvPlacementData *
+get_conv_placement_data(const char *id)
 {
 	ConvPlacementData *data = NULL;
 	GList *n;
@@ -2373,7 +2383,7 @@
 
 static void
 add_conv_placement_fnc(const char *id, const char *name,
-		GaimConvPlacementFunc fnc)
+					   GaimConvPlacementFunc fnc)
 {
 	ConvPlacementData *data;
 
@@ -2384,13 +2394,13 @@
 	data->fnc  = fnc;
 
 	conv_placement_fncs = g_list_append(conv_placement_fncs, data);
-
 }
 
 static void
 ensure_default_funcs(void)
 {
-	if (conv_placement_fncs == NULL) {
+	if (conv_placement_fncs == NULL)
+	{
 		add_conv_placement_fnc("last", _("Last created window"),
 							   conv_placement_last_created_win);
 		add_conv_placement_fnc("new", _("New window"),