Re: [evolution-patches] Addressbook: importing contacts.



Sorry for the mistake.
Here is the patch for finding the size of the file,
it fixes the crash while displaying the import status.

Please review.
Thanks,
Sushma.

On Wed, 2005-08-03 at 18:58 +0800, Not Zed wrote:
> It's wrong.
> 
> The loop should import 50 at a time, and then if there are any more, it
> should re-call the idle handler, until it is finished.
> 
> It must not import them all in one go, as it could lock up the ui for an
> unreasonable amount of time.
> 
> That's why it is in an idle handler.
> 

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	4 Aug 2005 04:41:51 -0000
@@ -618,7 +618,8 @@ ldif_import(EImport *ei, EImportTarget *
 	gci->target = target;
 	gci->book = book;
 	gci->file = file;
-	gci->size = fseek(file, 0, SEEK_END);
+	fseek(file, 0, SEEK_END);
+	gci->size = ftell(file);
 	fseek(file, 0, SEEK_SET);
 	gci->dn_contact_hash = g_hash_table_new(g_str_hash, g_str_equal);
 
Index: addressbook/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/ChangeLog,v
retrieving revision 1.1971
diff -u -p -r1.1971 ChangeLog
--- addressbook/ChangeLog	3 Aug 2005 08:34:01 -0000	1.1971
+++ addressbook/ChangeLog	4 Aug 2005 04:50:10 -0000
@@ -1,3 +1,8 @@
+2005-03-04  Sushma Rai  <rsushma novell com>
+
+	* importers/evolution-ldif-importer.c (ldif_import): Initialize gci->size to
+	the file size, which is used for indicationg the import progress.
+
 2005-03-03  Sushma Rai  <rsushma novell com>
 
 	* gui/widgets/eab-gui-util.c (eab_transfer_contacts): Initialize the


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