aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component/addressbook-component.c
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/gui/component/addressbook-component.c')
-rw-r--r--addressbook/gui/component/addressbook-component.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c
index 1ef6b1675c..e60c383cb9 100644
--- a/addressbook/gui/component/addressbook-component.c
+++ b/addressbook/gui/component/addressbook-component.c
@@ -395,7 +395,7 @@ owner_unset_cb (EvolutionShellComponent *shell_component,
/* FIXME We should perhaps take the time to figure out if the book is editable. */
static void
-local_addressbook_cb (EBook *book, gpointer closure)
+new_item_cb (EBook *book, gpointer closure)
{
gboolean is_list = GPOINTER_TO_INT (closure);
if (book == NULL)
@@ -407,15 +407,6 @@ local_addressbook_cb (EBook *book, gpointer closure)
}
static void
-nonlocal_addressbook_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- if (status == E_BOOK_STATUS_SUCCESS)
- local_addressbook_cb (book, closure);
- else
- local_addressbook_cb (NULL, closure);
-}
-
-static void
user_create_new_item_cb (EvolutionShellComponent *shell_component,
const char *id,
const char *parent_folder_physical_uri,
@@ -432,18 +423,10 @@ user_create_new_item_cb (EvolutionShellComponent *shell_component,
return;
}
if (IS_CONTACT_TYPE (parent_folder_type)) {
- EBook *book;
- gchar *uri;
-
- book = e_book_new ();
- uri = g_strdup_printf ("%s/addressbook.db", parent_folder_physical_uri);
-
- if (addressbook_load_uri (book, uri, nonlocal_addressbook_cb, GINT_TO_POINTER (is_contact_list)) == 0)
- g_warning ("Couldn't load addressbook %s", uri);
-
- g_free (uri);
+ e_book_use_address_book_by_uri (parent_folder_physical_uri,
+ new_item_cb, GINT_TO_POINTER (is_contact_list));
} else {
- e_book_use_local_address_book (local_addressbook_cb, GINT_TO_POINTER (is_contact_list));
+ e_book_use_default_book (new_item_cb, GINT_TO_POINTER (is_contact_list));
}
}