[evolution-patches] Patch for addressbook import



Hi,

Attached is the patch which allows to import vcf and ldif files.
I see that ldif import is still failing, I'll send another patch
to fix that.

Please review,
-Sushma.


Index: addressbook/importers/evolution-vcard-importer.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/importers/evolution-vcard-importer.c,v
retrieving revision 1.14
diff -u -p -r1.14 evolution-vcard-importer.c
--- addressbook/importers/evolution-vcard-importer.c	12 Jul 2005 04:04:09 -0000	1.14
+++ addressbook/importers/evolution-vcard-importer.c	12 Jul 2005 14:50:03 -0000
@@ -419,7 +419,7 @@ vcard_supported(EImport *ei, EImportTarg
 	if (s->uri_src == NULL)
 		return TRUE;
 
-	if (!strncmp(s->uri_src, "file:///", 8))
+	if (strncmp(s->uri_src, "file:///", 8) != 0)
 		return FALSE;
 
 	/* FIXME: need to parse the url properly */
Index: addressbook/importers/evolution-ldif-importer.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/importers/evolution-ldif-importer.c,v
retrieving revision 1.12
diff -u -p -r1.12 evolution-ldif-importer.c
--- addressbook/importers/evolution-ldif-importer.c	12 Jul 2005 04:04:09 -0000	1.12
+++ addressbook/importers/evolution-ldif-importer.c	12 Jul 2005 14:50:12 -0000
@@ -548,7 +548,7 @@ ldif_supported(EImport *ei, EImportTarge
 	if (s->uri_src == NULL)
 		return TRUE;
 
-	if (!strncmp(s->uri_src, "file:///", 8))
+	if (strncmp(s->uri_src, "file:///", 8) != 0)
 		return FALSE;
 
 	ext = strrchr(s->uri_src, '.');
@@ -604,7 +604,7 @@ ldif_import(EImport *ei, EImportTarget *
 		return;
 	}
 
-	file = fopen(s->uri_src, "r");
+	file = fopen(s->uri_src+7, "r");
 	if (file == NULL) {
 		g_message(G_STRLOC ":Can't open .ldif file");
 		e_import_complete(ei, target);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]