aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/contact-list-editor/e-contact-list-editor.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-01-24 03:59:41 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-01-30 21:37:15 +0800
commite583928e0401a4baea4432c5b7e12a1b1eff8c2e (patch)
tree786d3c1b3ed24456d88f3b8c6987755a08f310db /addressbook/gui/contact-list-editor/e-contact-list-editor.c
parent5125cdac38ced3898bdd59ed29259e4c747374f7 (diff)
downloadgsoc2013-evolution-e583928e0401a4baea4432c5b7e12a1b1eff8c2e.tar
gsoc2013-evolution-e583928e0401a4baea4432c5b7e12a1b1eff8c2e.tar.gz
gsoc2013-evolution-e583928e0401a4baea4432c5b7e12a1b1eff8c2e.tar.bz2
gsoc2013-evolution-e583928e0401a4baea4432c5b7e12a1b1eff8c2e.tar.lz
gsoc2013-evolution-e583928e0401a4baea4432c5b7e12a1b1eff8c2e.tar.xz
gsoc2013-evolution-e583928e0401a4baea4432c5b7e12a1b1eff8c2e.tar.zst
gsoc2013-evolution-e583928e0401a4baea4432c5b7e12a1b1eff8c2e.zip
Use e_book_client_connect().
Instead of e_client_utils_open_new() and e_book_client_new().
Diffstat (limited to 'addressbook/gui/contact-list-editor/e-contact-list-editor.c')
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
index 58ea7046dc..6f92e511de 100644
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c
+++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
@@ -301,26 +301,29 @@ contact_list_editor_add_email (EContactListEditor *editor,
}
static void
-contact_list_editor_book_loaded_cb (GObject *source_object,
- GAsyncResult *result,
- gpointer user_data)
+contact_list_editor_client_connect_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data)
{
ESource *source = E_SOURCE (source_object);
EContactListEditor *editor = user_data;
EContactListEditorPrivate *priv = editor->priv;
EContactStore *contact_store;
ENameSelectorEntry *entry;
- EClient *client = NULL;
+ EClient *client;
EBookClient *book_client;
GError *error = NULL;
- e_client_utils_open_new_finish (source, result, &client, &error);
+ client = e_book_client_connect_finish (result, &error);
+
+ /* Sanity check. */
+ g_return_if_fail (
+ ((client != NULL) && (error == NULL)) ||
+ ((client == NULL) && (error != NULL)));
if (error != NULL) {
GtkWindow *parent;
- g_warn_if_fail (client == NULL);
-
parent = eab_editor_get_window (EAB_EDITOR (editor));
eab_load_error_dialog (GTK_WIDGET (parent), NULL, source, error);
@@ -332,8 +335,6 @@ contact_list_editor_book_loaded_cb (GObject *source_object,
goto exit;
}
- g_return_if_fail (E_IS_CLIENT (client));
-
book_client = E_BOOK_CLIENT (client);
entry = E_NAME_SELECTOR_ENTRY (WIDGET (EMAIL_ENTRY));
@@ -977,9 +978,9 @@ contact_list_editor_source_menu_changed_cb (GtkWidget *widget)
client_source = e_client_get_source (client);
if (!e_source_equal (client_source, active_source))
- e_client_utils_open_new (
- active_source, E_CLIENT_SOURCE_TYPE_CONTACTS,
- FALSE, NULL, contact_list_editor_book_loaded_cb,
+ e_book_client_connect (
+ active_source, NULL,
+ contact_list_editor_client_connect_cb,
g_object_ref (editor));
g_object_unref (active_source);