diff options
author | Sushma Rai <rsushma@src.gnome.org> | 2005-07-13 16:29:39 +0800 |
---|---|---|
committer | Sushma Rai <rsushma@src.gnome.org> | 2005-07-13 16:29:39 +0800 |
commit | f58c45ce13747878fcb9e913d2d3dc5406ebef51 (patch) | |
tree | 29ddc401d6fff5ee778c3b8df0b9c9a2bcbe7579 | |
parent | 5582982cfd465cc45b7a0f50e9e45a6fbf79ce1b (diff) | |
download | gsoc2013-evolution-f58c45ce13747878fcb9e913d2d3dc5406ebef51.tar gsoc2013-evolution-f58c45ce13747878fcb9e913d2d3dc5406ebef51.tar.gz gsoc2013-evolution-f58c45ce13747878fcb9e913d2d3dc5406ebef51.tar.bz2 gsoc2013-evolution-f58c45ce13747878fcb9e913d2d3dc5406ebef51.tar.lz gsoc2013-evolution-f58c45ce13747878fcb9e913d2d3dc5406ebef51.tar.xz gsoc2013-evolution-f58c45ce13747878fcb9e913d2d3dc5406ebef51.tar.zst gsoc2013-evolution-f58c45ce13747878fcb9e913d2d3dc5406ebef51.zip |
Fix for address book import problems.
svn path=/trunk/; revision=29750
-rw-r--r-- | addressbook/ChangeLog | 12 | ||||
-rw-r--r-- | addressbook/importers/evolution-ldif-importer.c | 8 | ||||
-rw-r--r-- | addressbook/importers/evolution-vcard-importer.c | 2 |
3 files changed, 17 insertions, 5 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 640c480f42..78db70937b 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,15 @@ +2005-07-13 Sushma Rai <rsushma@novell.com> + + * addressbook/importers/evolution-vcard-importer.c (vcard_supported): + Return false in the source URI does not start with "file://". + + * addressbook/importers/evolution-ldif-importer.c + (ldif_import_contacts): Using the proper file pointer. + (ldif_supported): Return false in the source URI does not start with + "file://". + (ldif_import_done): Close the file opened. + (ldif_import): Opening the proper file. + 2005-07-09 Veerapuram Varadhan <vvaradhan@novell.com> * gui/component/addressbook-component.c: (impl_createControls): diff --git a/addressbook/importers/evolution-ldif-importer.c b/addressbook/importers/evolution-ldif-importer.c index d5b6aa8dbc..b989fb5385 100644 --- a/addressbook/importers/evolution-ldif-importer.c +++ b/addressbook/importers/evolution-ldif-importer.c @@ -443,7 +443,6 @@ static gboolean ldif_import_contacts(void *d) { LDIFImporter *gci = d; - FILE * file; EContact *contact; GSList *iter; int count = 0; @@ -452,7 +451,7 @@ ldif_import_contacts(void *d) ones till the end */ if (gci->state == 0) { - while (count < 50 && (contact = getNextLDIFEntry(gci, file))) { + while (count < 50 && (contact = getNextLDIFEntry(gci, gci->file))) { if (e_contact_get (contact, E_CONTACT_IS_LIST)) { gci->list_contacts = g_slist_prepend(gci->list_contacts, contact); } else { @@ -548,7 +547,7 @@ ldif_supported(EImport *ei, EImportTarget *target, EImportImporter *im) 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, '.'); @@ -575,6 +574,7 @@ ldif_import_done(LDIFImporter *gci) if (gci->idle_id) g_source_remove(gci->idle_id); + fclose (gci->file); g_object_unref(gci->book); g_slist_foreach(gci->contacts, (GFunc) g_object_unref, NULL); g_slist_foreach(gci->list_contacts, (GFunc) g_object_unref, NULL); @@ -604,7 +604,7 @@ ldif_import(EImport *ei, EImportTarget *target, EImportImporter *im) 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); diff --git a/addressbook/importers/evolution-vcard-importer.c b/addressbook/importers/evolution-vcard-importer.c index c53d687d26..e4be880dea 100644 --- a/addressbook/importers/evolution-vcard-importer.c +++ b/addressbook/importers/evolution-vcard-importer.c @@ -419,7 +419,7 @@ vcard_supported(EImport *ei, EImportTarget *target, EImportImporter *im) 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 */ |