aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/importers/evolution-csv-importer.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-12-04 02:01:31 +0800
committerMilan Crha <mcrha@redhat.com>2010-12-04 02:01:31 +0800
commit3a6932bd9f251d5faafc5dc0c419e7c80d5afcd0 (patch)
tree28a0f3313e4233b77c47655b02f604bcc9e47acc /addressbook/importers/evolution-csv-importer.c
parentd8999c79baa0385e1234eaa114b384cfef1d745f (diff)
downloadgsoc2013-evolution-3a6932bd9f251d5faafc5dc0c419e7c80d5afcd0.tar
gsoc2013-evolution-3a6932bd9f251d5faafc5dc0c419e7c80d5afcd0.tar.gz
gsoc2013-evolution-3a6932bd9f251d5faafc5dc0c419e7c80d5afcd0.tar.bz2
gsoc2013-evolution-3a6932bd9f251d5faafc5dc0c419e7c80d5afcd0.tar.lz
gsoc2013-evolution-3a6932bd9f251d5faafc5dc0c419e7c80d5afcd0.tar.xz
gsoc2013-evolution-3a6932bd9f251d5faafc5dc0c419e7c80d5afcd0.tar.zst
gsoc2013-evolution-3a6932bd9f251d5faafc5dc0c419e7c80d5afcd0.zip
Bug #635755 - Authenticate books in addressbook importers on open
Diffstat (limited to 'addressbook/importers/evolution-csv-importer.c')
-rw-r--r--addressbook/importers/evolution-csv-importer.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/addressbook/importers/evolution-csv-importer.c b/addressbook/importers/evolution-csv-importer.c
index 970ada7fd6..9e15a58dee 100644
--- a/addressbook/importers/evolution-csv-importer.c
+++ b/addressbook/importers/evolution-csv-importer.c
@@ -37,6 +37,7 @@
#include <libebook/e-destination.h>
#include "e-util/e-import.h"
+#include "util/addressbook.h"
#include "evolution-addressbook-importers.h"
@@ -827,6 +828,20 @@ csv_import_done (CSVImporter *gci)
}
static void
+book_loaded_cb (EBook *book, const GError *error, gpointer closure)
+{
+ CSVImporter *gci = closure;
+
+ g_return_if_fail (gci != NULL);
+ g_return_if_fail (gci->book == book);
+
+ if (error)
+ csv_import_done (gci);
+ else
+ gci->idle_id = g_idle_add (csv_import_contacts, gci);
+}
+
+static void
csv_import (EImport *ei, EImportTarget *target, EImportImporter *im)
{
CSVImporter *gci;
@@ -870,9 +885,7 @@ csv_import (EImport *ei, EImportTarget *target, EImportImporter *im)
gci->size = ftell (file);
fseek (file, 0, SEEK_SET);
- e_book_open (gci->book, FALSE, NULL);
-
- gci->idle_id = g_idle_add (csv_import_contacts, gci);
+ addressbook_load (gci->book, book_loaded_cb, gci);
}
static void