aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/importers/evolution-ldif-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-ldif-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-ldif-importer.c')
-rw-r--r--addressbook/importers/evolution-ldif-importer.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/addressbook/importers/evolution-ldif-importer.c b/addressbook/importers/evolution-ldif-importer.c
index 15627bad5a..f5fe14bd6b 100644
--- a/addressbook/importers/evolution-ldif-importer.c
+++ b/addressbook/importers/evolution-ldif-importer.c
@@ -47,6 +47,7 @@
#include <libebook/e-destination.h>
#include "e-util/e-import.h"
+#include "util/addressbook.h"
#include "evolution-addressbook-importers.h"
@@ -621,6 +622,20 @@ ldif_import_done (LDIFImporter *gci)
}
static void
+book_loaded_cb (EBook *book, const GError *error, gpointer closure)
+{
+ LDIFImporter *gci = closure;
+
+ g_return_if_fail (gci != NULL);
+ g_return_if_fail (gci->book == book);
+
+ if (error)
+ ldif_import_done (gci);
+ else
+ gci->idle_id = g_idle_add (ldif_import_contacts, gci);
+}
+
+static void
ldif_import (EImport *ei, EImportTarget *target, EImportImporter *im)
{
LDIFImporter *gci;
@@ -662,9 +677,7 @@ ldif_import (EImport *ei, EImportTarget *target, EImportImporter *im)
(GDestroyNotify) g_free,
(GDestroyNotify) NULL);
- e_book_open (gci->book, FALSE, NULL);
-
- gci->idle_id = g_idle_add (ldif_import_contacts, gci);
+ addressbook_load (gci->book, book_loaded_cb, gci);
}
static void