diff options
Diffstat (limited to 'addressbook/tools/evolution-addressbook-export-list-folders.c')
-rw-r--r-- | addressbook/tools/evolution-addressbook-export-list-folders.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/addressbook/tools/evolution-addressbook-export-list-folders.c b/addressbook/tools/evolution-addressbook-export-list-folders.c index bfaf110cb9..29c44dbeba 100644 --- a/addressbook/tools/evolution-addressbook-export-list-folders.c +++ b/addressbook/tools/evolution-addressbook-export-list-folders.c @@ -52,6 +52,7 @@ action_list_folders_init (ESourceRegistry *registry, list = e_source_registry_list_sources (registry, extension_name); for (iter = list; iter != NULL; iter = g_list_next (iter)) { + EClient *client; EBookClient *book_client; EBookQuery *query; ESource *source; @@ -63,23 +64,24 @@ action_list_folders_init (ESourceRegistry *registry, source = E_SOURCE (iter->data); - book_client = e_book_client_new (source, &error); + client = e_book_client_connect_sync (source, NULL, &error); - if (book_client != NULL) - e_client_open_sync ( - E_CLIENT (book_client), TRUE, NULL, &error); + /* Sanity check. */ + g_return_val_if_fail ( + ((client != NULL) && (error == NULL)) || + ((client == NULL) && (error != NULL)), FAILED); if (error != NULL) { g_warning ( _("Failed to open client '%s': %s"), e_source_get_display_name (source), error->message); - if (book_client != NULL) - g_object_unref (book_client); g_error_free (error); continue; } + book_client = E_BOOK_CLIENT (client); + query = e_book_query_any_field_contains (""); query_str = e_book_query_to_string (query); e_book_query_unref (query); |