changeset 11212:46086fcc82b7

[gaim-migrate @ 13343] Weird things happen when account is NULL in screenname_completion_match_selected_cb(). I fixed that. Then I fixed the bug I introduced that caused account to be NULL all the time. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Mon, 08 Aug 2005 19:56:41 +0000
parents 03a244acce57
children ff728e84d59a
files src/gtkrequest.c
diffstat 1 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkrequest.c	Mon Aug 08 19:45:28 2005 +0000
+++ b/src/gtkrequest.c	Mon Aug 08 19:56:41 2005 +0000
@@ -763,11 +763,19 @@
 	GValue val = { 0, };
 	GaimRequestField *screen_field = user_data[1];
 	GList *fields = screen_field->group->fields;
+	GaimAccount *account;
 
 	gtk_tree_model_get_value(model, iter, 1, &val);
 	gtk_entry_set_text(GTK_ENTRY(user_data[0]), g_value_get_string(&val));
 	g_value_unset(&val);
 
+	gtk_tree_model_get_value(model, iter, 4, &val);
+	account = g_value_get_pointer(&val);
+	g_value_unset(&val);
+
+	if (account == NULL)
+		return TRUE;
+
 	do {
 		GaimRequestField *field = fields->data;
 
@@ -776,13 +784,8 @@
 
 			if (type_hint != NULL && !strcmp(type_hint, "account")) {
 				/* We found the corresponding account field. */
-				GaimAccount *account;
 				GtkOptionMenu *optmenu = GTK_OPTION_MENU(field->ui_data);
 
-				gtk_tree_model_get_value(model, iter, 4, &val);
-				account = g_value_get_pointer(&val);
-				g_value_unset(&val);
-
 				/* Set the account in the request API. */
 				gaim_request_field_account_set_value(field, account);
 
@@ -793,7 +796,6 @@
 					do {
 						if (account == g_object_get_data(G_OBJECT(items->data), "account")) {
 							/* Set the account in the GUI. */
-
 							gtk_option_menu_set_history(GTK_OPTION_MENU(field->ui_data), index);
 							return TRUE;
 						}
@@ -914,7 +916,7 @@
 #ifdef NEW_STYLE_COMPLETION
 	/* Store the displayed completion value, the screenname, the UTF-8 normalized & casefolded screenname,
 	 * the UTF-8 normalized & casefolded value for comparison, and the account. */
-	GtkListStore *store = gtk_list_store_new(4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER);
+	GtkListStore *store = gtk_list_store_new(5, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER);
 
 	GaimBlistNode *gnode, *cnode, *bnode;
 	GHashTable *sets;