[addressbook] Patch for bug #303046

Devashish <[email protected]>
Newsgroups gmane.comp.gnome.evolution.patches
Organization Novell
Message-ID <[email protected]>
Hi, 

The attach patch fixes the bug 

303046 – Select Contacts From Address Book Screen Doesn't Use Current
Contact Source

Thanks
Devashish Sharma

_______________________________________________
Evolution-patches mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/evolution-patches
diff.1 (text/x-patch, 1.8 KB)
Index: libedataserverui/e-name-selector-dialog.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/libedataserverui/e-name-selector-dialog.c,v
retrieving revision 1.26
diff -u -p -r1.26 e-name-selector-dialog.c
--- libedataserverui/e-name-selector-dialog.c	1 Feb 2006 08:26:33 -0000	1.26
+++ libedataserverui/e-name-selector-dialog.c	3 Feb 2006 08:44:28 -0000
@@ -222,6 +222,29 @@ e_name_selector_dialog_init (ENameSelect
 	/* Create source menu */
 
 	widget = e_source_option_menu_new (name_selector_dialog->source_list);
+        
+	GConfClient *gconf_client;	
+	char *uid;
+	
+	gconf_client = gconf_client_get_default();
+	uid = gconf_client_get_string (gconf_client, "/apps/evolution/addressbook/display/primary_addressbook",
+			NULL);
+	g_object_unref (gconf_client);
+	if (uid) {
+		ESource *source = e_source_list_peek_source_by_uid(name_selector_dialog->source_list, uid);
+		if (source) {
+			e_source_option_menu_select ((ESourceOptionMenu *)widget, source);
+			source_selected (name_selector_dialog, source);
+		}
+		else {
+			source_selected (name_selector_dialog, find_first_source (name_selector_dialog->source_list));
+		}
+		g_free (uid);
+	}
+	else {
+		source_selected (name_selector_dialog, find_first_source (name_selector_dialog->source_list));
+	}
+
 	g_signal_connect_swapped (widget, "source_selected", G_CALLBACK (source_selected), name_selector_dialog);
 
 	label = glade_xml_get_widget (name_selector_dialog->gui, "AddressBookLabel");
@@ -243,7 +266,6 @@ e_name_selector_dialog_init (ENameSelect
 
 	/* TODO: Remember last used source */
 
-	source_selected (name_selector_dialog, find_first_source (name_selector_dialog->source_list));
 
 	/* Set up dialog defaults */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.