diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-01-24 03:59:41 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-01-30 21:37:15 +0800 |
commit | e583928e0401a4baea4432c5b7e12a1b1eff8c2e (patch) | |
tree | 786d3c1b3ed24456d88f3b8c6987755a08f310db /e-util/e-name-selector.c | |
parent | 5125cdac38ced3898bdd59ed29259e4c747374f7 (diff) | |
download | gsoc2013-evolution-e583928e0401a4baea4432c5b7e12a1b1eff8c2e.tar.gz 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.c')
-rw-r--r-- | e-util/e-name-selector.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/e-util/e-name-selector.c b/e-util/e-name-selector.c index a94b6ff5f3..66d93512d0 100644 --- a/e-util/e-name-selector.c +++ b/e-util/e-name-selector.c @@ -32,7 +32,6 @@ #include "e-name-selector.h" -#include "e-client-utils.h" #include "e-contact-store.h" #include "e-destination-store.h" @@ -91,20 +90,25 @@ reset_pointer_cb (gpointer data, } static void -name_selector_book_loaded_cb (GObject *source_object, - GAsyncResult *result, - gpointer user_data) +name_selector_book_client_connect_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { ENameSelector *name_selector = user_data; ESource *source = E_SOURCE (source_object); EBookClient *book_client; - EClient *client = NULL; + EClient *client; GArray *sections; SourceBook source_book; guint ii; 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) { if (!g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_REPOSITORY_OFFLINE) @@ -186,10 +190,9 @@ e_name_selector_load_books (ENameSelector *name_selector) if (!e_source_autocomplete_get_include_me (extension)) continue; - e_client_utils_open_new ( - source, E_CLIENT_SOURCE_TYPE_CONTACTS, - TRUE, name_selector->priv->cancellable, - name_selector_book_loaded_cb, + e_book_client_connect ( + source, name_selector->priv->cancellable, + name_selector_book_client_connect_cb, g_object_ref (name_selector)); } |