aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-name-selector-entry.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 /e-util/e-name-selector-entry.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 'e-util/e-name-selector-entry.c')
-rw-r--r--e-util/e-name-selector-entry.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/e-util/e-name-selector-entry.c b/e-util/e-name-selector-entry.c
index 45038c0fee..58c7b391fd 100644
--- a/e-util/e-name-selector-entry.c
+++ b/e-util/e-name-selector-entry.c
@@ -28,7 +28,6 @@
#include <camel/camel.h>
#include <libebackend/libebackend.h>
-#include "e-client-utils.h"
#include "e-name-selector-entry.h"
#define E_NAME_SELECTOR_ENTRY_GET_PRIVATE(obj) \
@@ -2206,27 +2205,29 @@ setup_contact_store (ENameSelectorEntry *name_selector_entry)
}
static void
-book_loaded_cb (GObject *source_object,
- GAsyncResult *result,
- gpointer user_data)
+book_client_connect_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data)
{
EContactStore *contact_store = user_data;
- ESource *source = E_SOURCE (source_object);
EBookClient *book_client;
- EClient *client = NULL;
+ EClient *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 (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
- g_warn_if_fail (client == NULL);
g_error_free (error);
goto exit;
}
if (error != NULL) {
g_warning ("%s", error->message);
- g_warn_if_fail (client == NULL);
g_error_free (error);
goto exit;
}
@@ -2287,9 +2288,10 @@ setup_default_contact_store (ENameSelectorEntry *name_selector_entry)
&name_selector_entry->priv->cancellables,
cancellable);
- e_client_utils_open_new (
- source, E_CLIENT_SOURCE_TYPE_CONTACTS, TRUE, cancellable,
- book_loaded_cb, g_object_ref (contact_store));
+ e_book_client_connect (
+ source, cancellable,
+ book_client_connect_cb,
+ g_object_ref (contact_store));
}
g_list_free_full (list, (GDestroyNotify) g_object_unref);