changeset 32707:c7de9dc7c5b3

Avoid calling gtk_combo_box_set_active twice in some cases.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Thu, 29 Dec 2011 05:36:32 +0000
parents b8a6a07aa5b0
children c2df5063d430
files pidgin/gtkutils.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkutils.c	Thu Dec 29 04:47:14 2011 +0000
+++ b/pidgin/gtkutils.c	Thu Dec 29 05:36:32 2011 +0000
@@ -679,8 +679,6 @@
 	gtk_cell_layout_add_attribute(GTK_CELL_LAYOUT(optmenu), cr, "text", AOP_NAME_COLUMN);
 
 	aop_option_menu_replace_menu(optmenu, aop_menu);
-	if (aop_menu->default_item == -1)
-		gtk_combo_box_set_active(GTK_COMBO_BOX(optmenu), 0);
 	g_object_set_data(G_OBJECT(optmenu), "user_data", user_data);
 
 	g_signal_connect(G_OBJECT(optmenu), "changed", G_CALLBACK(aop_menu_cb), cb);
@@ -720,7 +718,7 @@
 	ls = gtk_list_store_new(AOP_COLUMN_COUNT, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_POINTER);
 
 	aop_menu = g_malloc0(sizeof(AopMenu));
-	aop_menu->default_item = -1;
+	aop_menu->default_item = 0;
 	aop_menu->model = GTK_TREE_MODEL(ls);
 
 	for (p = purple_plugins_get_protocols(), i = 0;
@@ -744,6 +742,7 @@
 		if (default_proto_id != NULL && !strcmp(plugin->info->id, default_proto_id))
 			aop_menu->default_item = i;
 	}
+
 	return aop_menu;
 }
 
@@ -788,7 +787,7 @@
 	ls = gtk_list_store_new(AOP_COLUMN_COUNT, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_POINTER);
 
 	aop_menu = g_malloc0(sizeof(AopMenu));
-	aop_menu->default_item = -1;
+	aop_menu->default_item = 0;
 	aop_menu->model = GTK_TREE_MODEL(ls);
 
 	for (p = list, i = 0; p != NULL; p = p->next, i++) {
@@ -837,6 +836,7 @@
 		if (default_account && account == default_account)
 			aop_menu->default_item = i;
 	}
+
 	return aop_menu;
 }