From e583928e0401a4baea4432c5b7e12a1b1eff8c2e Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 23 Jan 2013 14:59:41 -0500 Subject: Use e_book_client_connect(). Instead of e_client_utils_open_new() and e_book_client_new(). --- plugins/bbdb/bbdb.c | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) (limited to 'plugins/bbdb/bbdb.c') diff --git a/plugins/bbdb/bbdb.c b/plugins/bbdb/bbdb.c index 7187f6e376..568bd90733 100644 --- a/plugins/bbdb/bbdb.c +++ b/plugins/bbdb/bbdb.c @@ -137,7 +137,7 @@ bbdb_do_in_thread (gpointer data) EBookClient *client = data; /* Open the addressbook */ - if (!client || !bbdb_open_book_client (client)) { + if (client == NULL) { G_LOCK (todo); g_slist_foreach (todo, (GFunc) free_todo_struct, NULL); @@ -370,7 +370,7 @@ bbdb_create_book_client (gint type) EShell *shell; ESource *source = NULL; ESourceRegistry *registry; - EBookClient *client = NULL; + EClient *client = NULL; GSettings *settings; gboolean enable = TRUE; gchar *uid; @@ -406,7 +406,7 @@ bbdb_create_book_client (gint type) if (source == NULL) source = e_source_registry_ref_builtin_address_book (registry); - client = e_book_client_new (source, &error); + client = e_book_client_connect_sync (source, NULL, &error); if (client == NULL) { g_warning ( "bbdb: Failed to get addressbook: %s\n", @@ -416,29 +416,7 @@ bbdb_create_book_client (gint type) g_object_unref (source); - return client; -} - -gboolean -bbdb_open_book_client (EBookClient *client) -{ - GError *error = NULL; - - if (!client) - return FALSE; - - e_client_open_sync (E_CLIENT (client), FALSE, NULL, &error); - - if (error != NULL) { - g_warning ( - "bbdb: failed to open addressbook: %s", - error->message); - g_object_unref (client); - g_error_free (error); - return FALSE; - } - - return TRUE; + return (EBookClient *) client; } gboolean -- cgit v1.2.3