[evolution-patches] Addressbook: importing contacts.



Currently only 50 items are getting imported.
Please review the attached patch.

Thanks,
Sushma.

Index: addressbook/importers/evolution-vcard-importer.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/importers/evolution-vcard-importer.c,v
retrieving revision 1.15
diff -u -p -r1.15 evolution-vcard-importer.c
--- addressbook/importers/evolution-vcard-importer.c	13 Jul 2005 08:29:39 -0000	1.15
+++ addressbook/importers/evolution-vcard-importer.c	3 Aug 2005 07:14:46 -0000
@@ -232,7 +232,7 @@ vcard_import_contacts(void *data)
 	GList *iterator = gci->iterator;
 
 	if (gci->state == 0) {
-		while (count < 50 && iterator) {
+		while (iterator) {
 			vcard_import_contact(gci, iterator->data);
 			count++;
 			iterator = iterator->next;
Index: addressbook/importers/evolution-ldif-importer.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/importers/evolution-ldif-importer.c,v
retrieving revision 1.13
diff -u -p -r1.13 evolution-ldif-importer.c
--- addressbook/importers/evolution-ldif-importer.c	13 Jul 2005 08:29:39 -0000	1.13
+++ addressbook/importers/evolution-ldif-importer.c	3 Aug 2005 07:14:59 -0000
@@ -445,13 +445,12 @@ ldif_import_contacts(void *d)
 	LDIFImporter *gci = d;
 	EContact *contact;
 	GSList *iter;
-	int count = 0;
 
 	/* We process all normal cards immediately and keep the list
 	   ones till the end */
 
 	if (gci->state == 0) {
-		while (count < 50 && (contact = getNextLDIFEntry(gci, gci->file))) {
+		while ((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 {
@@ -461,7 +460,6 @@ ldif_import_contacts(void *d)
 				e_book_add_contact(gci->book, contact, NULL);
 				gci->contacts = g_slist_prepend(gci->contacts, contact);
 			}
-			count++;
 		}
 		if (contact == NULL) {
 			gci->state = 1;
@@ -469,11 +467,10 @@ ldif_import_contacts(void *d)
 		}
 	}
 	if (gci->state == 1) {
-		for (iter = gci->list_iterator;count < 50 && iter;iter=iter->next) {
+		for (iter = gci->list_iterator; iter; iter=iter->next) {
 			contact = iter->data;
 			resolve_list_card(gci, contact);
 			e_book_add_contact(gci->book, contact, NULL);
-			count++;
 		}
 		gci->list_iterator = iter;
 		if (iter == NULL)
Index: addressbook/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/ChangeLog,v
retrieving revision 1.1969
diff -u -p -r1.1969 ChangeLog
--- addressbook/ChangeLog	3 Aug 2005 06:11:55 -0000	1.1969
+++ addressbook/ChangeLog	3 Aug 2005 08:04:17 -0000
@@ -1,3 +1,11 @@
+2005-08-03  Sushma Rai  <rsushma novell com>
+
+	* importers/evolution-vcard-importer.c (vcard_import_contacts): 
+	Importing all the items and not just fifty.
+
+	* importers/evolution-ldif-importer.c (ldif_import_contacts): Similar.
+	
+
 2005-08-03  Frank Arnold  <farnold cvs gnome org>
 
 	* addressbook.error.xml: Marked string for translation


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