aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/importers
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/importers')
-rw-r--r--addressbook/importers/evolution-csv-importer.c11
-rw-r--r--addressbook/importers/evolution-ldif-importer.c8
-rw-r--r--addressbook/importers/evolution-vcard-importer.c10
3 files changed, 13 insertions, 16 deletions
diff --git a/addressbook/importers/evolution-csv-importer.c b/addressbook/importers/evolution-csv-importer.c
index 76607f342e..43e9339a81 100644
--- a/addressbook/importers/evolution-csv-importer.c
+++ b/addressbook/importers/evolution-csv-importer.c
@@ -716,7 +716,8 @@ getNextCSVEntry (CSVImporter *gci, FILE *f) {
}
static gboolean
-csv_import_contacts (gpointer d) {
+csv_import_contacts (gpointer d)
+{
CSVImporter *gci = d;
EContact *contact = NULL;
@@ -855,16 +856,14 @@ book_loaded_cb (GObject *source_object,
CSVImporter *gci = user_data;
EClient *client = NULL;
- if (!e_client_utils_open_new_finish (source, result, &client, NULL))
- client = NULL;
-
- gci->book_client = client ? E_BOOK_CLIENT (client) : NULL;
+ e_client_utils_open_new_finish (source, result, &client, NULL);
- if (gci->book_client == NULL) {
+ if (client == NULL) {
csv_import_done (gci);
return;
}
+ gci->book_client = E_BOOK_CLIENT (client);
gci->idle_id = g_idle_add (csv_import_contacts, gci);
}
diff --git a/addressbook/importers/evolution-ldif-importer.c b/addressbook/importers/evolution-ldif-importer.c
index 79d446cdaa..72776bf2a5 100644
--- a/addressbook/importers/evolution-ldif-importer.c
+++ b/addressbook/importers/evolution-ldif-importer.c
@@ -650,16 +650,14 @@ book_loaded_cb (GObject *source_object,
LDIFImporter *gci = user_data;
EClient *client = NULL;
- if (!e_client_utils_open_new_finish (source, result, &client, NULL))
- client = NULL;
+ e_client_utils_open_new_finish (source, result, &client, NULL);
- gci->book_client = client ? E_BOOK_CLIENT (client) : NULL;
-
- if (gci->book_client == NULL) {
+ if (client == NULL) {
ldif_import_done (gci);
return;
}
+ gci->book_client = E_BOOK_CLIENT (client);
gci->idle_id = g_idle_add (ldif_import_contacts, gci);
}
diff --git a/addressbook/importers/evolution-vcard-importer.c b/addressbook/importers/evolution-vcard-importer.c
index 09ad3d1f7f..59168d883b 100644
--- a/addressbook/importers/evolution-vcard-importer.c
+++ b/addressbook/importers/evolution-vcard-importer.c
@@ -486,16 +486,15 @@ book_loaded_cb (GObject *source_object,
VCardImporter *gci = user_data;
EClient *client = NULL;
- if (!e_client_utils_open_new_finish (source, result, &client, NULL))
- client = NULL;
+ e_client_utils_open_new_finish (source, result, &client, NULL);
- gci->book_client = client ? E_BOOK_CLIENT (client) : NULL;
-
- if (gci->book_client == NULL) {
+ if (client == NULL) {
vcard_import_done (gci);
return;
}
+ gci->book_client = E_BOOK_CLIENT (client);
+
if (gci->encoding == VCARD_ENCODING_UTF16) {
gchar *tmp;
@@ -503,6 +502,7 @@ book_loaded_cb (GObject *source_object,
tmp = utf16_to_utf8 (contents_utf16);
g_free (gci->contents);
gci->contents = tmp;
+
} else if (gci->encoding == VCARD_ENCODING_LOCALE) {
gchar *tmp;
tmp = g_locale_to_utf8 (gci->contents, -1, NULL, NULL, NULL);