diff options
Diffstat (limited to 'addressbook/gui/widgets/eab-gui-util.c')
-rw-r--r-- | addressbook/gui/widgets/eab-gui-util.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c index 089c12b573..2f0f29ea23 100644 --- a/addressbook/gui/widgets/eab-gui-util.c +++ b/addressbook/gui/widgets/eab-gui-util.c @@ -524,19 +524,22 @@ do_copy (gpointer data, } 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) { - ESource *destination = E_SOURCE (source_object); ContactCopyProcess *process = user_data; - EClient *client = NULL; + EClient *client; GError *error = NULL; - e_client_utils_open_new_finish (destination, 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) { - g_warn_if_fail (client == NULL); g_warning ( "%s: Failed to open destination client: %s", G_STRFUNC, error->message); @@ -544,8 +547,6 @@ book_loaded_cb (GObject *source_object, goto exit; } - g_return_if_fail (E_IS_CLIENT (client)); - process->destination = E_BOOK_CLIENT (client); process->book_status = TRUE; g_slist_foreach (process->contacts, do_copy, process); @@ -612,9 +613,8 @@ eab_transfer_contacts (ESourceRegistry *registry, process->alert_sink = alert_sink; process->delete_from_source = delete_from_source; - e_client_utils_open_new ( - destination, E_CLIENT_SOURCE_TYPE_CONTACTS, FALSE, NULL, - book_loaded_cb, process); + e_book_client_connect ( + destination, NULL, book_client_connect_cb, process); } /* |