diff options
Diffstat (limited to 'addressbook/gui')
-rw-r--r-- | addressbook/gui/component/select-names/e-select-names.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/addressbook/gui/component/select-names/e-select-names.c b/addressbook/gui/component/select-names/e-select-names.c index e1251fe0f6..e592999ef1 100644 --- a/addressbook/gui/component/select-names/e-select-names.c +++ b/addressbook/gui/component/select-names/e-select-names.c @@ -338,7 +338,12 @@ static void folder_selected (EvolutionFolderSelectorButton *button, GNOME_Evolution_Folder *folder, ESelectNames *e_select_names) { + Bonobo_ConfigDatabase db; + addressbook_model_set_uri(e_select_names, e_select_names->model, folder->physicalUri); + + db = addressbook_config_database (NULL); + bonobo_config_set_string (db, "/Addressbook/select_names_uri", folder->physicalUri, NULL); } static void @@ -468,8 +473,7 @@ e_select_names_init (ESelectNames *e_select_names) GtkWidget *widget, *button; const char *selector_types[] = { "contacts/*", NULL }; char *filename; - char *uri; - char *contacts_uri, *contacts_path; + char *contacts_uri; Bonobo_ConfigDatabase db; db = addressbook_config_database (NULL); @@ -541,25 +545,24 @@ e_select_names_init (ESelectNames *e_select_names) gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(update_query), e_select_names); - contacts_path = bonobo_config_get_string_with_default (db, "/DefaultFolders/contacts_path", - "evolution:/local/Contacts", - NULL); - - filename = gnome_util_prepend_user_home("evolution/local/Contacts"); - uri = g_strdup_printf("file://%s", filename); - - contacts_uri = bonobo_config_get_string_with_default (db, "/DefaultFolders/contacts_uri", - uri, - NULL); - - g_free (filename); - g_free (uri); + contacts_uri = bonobo_config_get_string_with_default (db, "/Addressbook/select_names_uri", + NULL, NULL); + if (!contacts_uri) { + contacts_uri = bonobo_config_get_string_with_default (db, "/DefaultFolders/contacts_uri", + NULL, + NULL); + } + if (!contacts_uri) { + filename = gnome_util_prepend_user_home("evolution/local/Contacts"); + contacts_uri = g_strdup_printf("file://%s", filename); + g_free (filename); + } button = glade_xml_get_widget (gui, "folder-selector"); evolution_folder_selector_button_construct (EVOLUTION_FOLDER_SELECTOR_BUTTON (button), global_shell_client, _("Find contact in"), - contacts_path, + contacts_uri, selector_types); if (button && EVOLUTION_IS_FOLDER_SELECTOR_BUTTON (button)) gtk_signal_connect(GTK_OBJECT(button), "selected", @@ -574,7 +577,6 @@ e_select_names_init (ESelectNames *e_select_names) addressbook_model_set_uri(e_select_names, e_select_names->model, contacts_uri); g_free (contacts_uri); - g_free (contacts_path); } static void e_select_names_child_free(char *key, ESelectNamesChild *child, ESelectNames *e_select_names) |