[evolution-patches] Patch for 1.4 Address Book Select Names Dialog



In testing 1.4.6, it was discovered that the select names dialog doesn't
correctly load the default folder, if no other folder was opened
previously using the folder selector button. The following patch fixes
the issue, by checking that the URI is not an empty string, as well as
not being NULL. It also passes the correct version of the URI to the
folder selector button, so the label and icon are set correctly (it
strips off the /addressbook.db). It also switches to using the standard
e_config_listener_get_string () instead of _with_default (), since we
are just passing NULL as the default anyway.

-- dobey

Index: gui/component/select-names/e-select-names.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/component/select-names/e-select-names.c,v
retrieving revision 1.119
diff -u -r1.119 e-select-names.c
--- gui/component/select-names/e-select-names.c	11 May 2003 20:48:15 -0000	1.119
+++ gui/component/select-names/e-select-names.c	8 Mar 2004 22:57:15 -0000
@@ -638,17 +638,16 @@
 	e_select_names = g_object_new (E_TYPE_SELECT_NAMES, NULL);
 
 	db = e_book_get_config_database ();
-	contacts_uri = e_config_listener_get_string_with_default (
-		db, "/apps/evolution/addressbook/select_names/last_used_uri",
-		NULL, NULL);
-	if (!contacts_uri)
+	contacts_uri = e_config_listener_get_string (
+		db, "/apps/evolution/addressbook/select_names/last_used_uri");
+	if (!contacts_uri || !strcmp (contacts_uri, ""))
 		contacts_uri = g_strdup (e_book_get_default_book_uri ());
 
 	button = glade_xml_get_widget (e_select_names->gui, "folder-selector");
 	evolution_folder_selector_button_construct (EVOLUTION_FOLDER_SELECTOR_BUTTON (button),
 						    shell_client,
 						    _("Find contact in"),
-						    contacts_uri,
+						    strcmp (strrchr (contacts_uri, '/') + 1, "addressbook.db") == 0 ? g_dirname (contacts_uri) : contacts_uri,
 						    selector_types);
 
 	addressbook_model_set_uri(e_select_names, e_select_names->model, contacts_uri);

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]