aboutsummaryrefslogtreecommitdiffstats
path: root/mail/importers/pine-importer.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-12-20 11:27:39 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-12-20 11:27:39 +0800
commit987fb91d5ec4b61d1283acdb9cf02960cc47b74d (patch)
tree5e9dc4fa1e10995f0217b068daff2ca6b77cf461 /mail/importers/pine-importer.c
parentda67edd2a675481fb90b8f5fcbeb3eaf5dc427ea (diff)
downloadgsoc2013-evolution-987fb91d5ec4b61d1283acdb9cf02960cc47b74d.tar
gsoc2013-evolution-987fb91d5ec4b61d1283acdb9cf02960cc47b74d.tar.gz
gsoc2013-evolution-987fb91d5ec4b61d1283acdb9cf02960cc47b74d.tar.bz2
gsoc2013-evolution-987fb91d5ec4b61d1283acdb9cf02960cc47b74d.tar.lz
gsoc2013-evolution-987fb91d5ec4b61d1283acdb9cf02960cc47b74d.tar.xz
gsoc2013-evolution-987fb91d5ec4b61d1283acdb9cf02960cc47b74d.tar.zst
gsoc2013-evolution-987fb91d5ec4b61d1283acdb9cf02960cc47b74d.zip
Reduce diff noise with account-mgmt branch.
Diffstat (limited to 'mail/importers/pine-importer.c')
-rw-r--r--mail/importers/pine-importer.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/mail/importers/pine-importer.c b/mail/importers/pine-importer.c
index ef39bcf62f..55522d34d7 100644
--- a/mail/importers/pine-importer.c
+++ b/mail/importers/pine-importer.c
@@ -176,7 +176,7 @@ import_contact (EBookClient *book_client,
static void
import_contacts (void)
{
- ESource *primary;
+ ESource *source;
ESourceList *source_list;
EBookClient *book_client;
gchar *name;
@@ -203,28 +203,23 @@ import_contacts (void)
if (fp == NULL)
return;
- primary = e_source_list_peek_source_any (source_list);
- /* FIXME Better error handling */
- if ((book_client = e_book_client_new (primary, &error)) == NULL) {
- fclose (fp);
- g_warning ("Could not create EBook: %s", error->message);
- if (error)
- g_error_free (error);
- return;
- }
+ source = e_source_list_peek_source_any (source_list);
- if (!e_client_open_sync (E_CLIENT (book_client), TRUE, NULL, &error)) {
- g_object_unref (source_list);
- fclose (fp);
+ book_client = e_book_client_new (source, &error);
+
+ if (book_client != NULL)
+ e_client_open_sync (E_CLIENT (book_client), TRUE, NULL, &error);
+ g_object_unref (source_list);
+
+ if (error != NULL) {
g_warning (
"%s: Failed to open book client: %s",
G_STRFUNC, error->message);
- if (error)
- g_error_free (error);
+ g_error_free (error);
+ fclose (fp);
return;
}
- g_object_unref (source_list);
line = g_string_new("");
g_string_set_size (line, 256);