From fa748c3bdcbc344dec8c1ddb03707661adecce3a Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Mon, 16 Apr 2001 23:06:07 +0000 Subject: Don't we want to tell where we are by using the start of the message? I 2001-04-16 Jeffrey Stedfast * providers/local/camel-mbox-summary.c (summary_rebuild): Don't we want to tell where we are by using the start of the message? I think this should be using camel_mime_parser_tell_start_from() instead. Also divide by the size *before* multiplying by 100 so that we don't overflow the int which was giving us negative values for our progress status (oops). svn path=/trunk/; revision=9394 --- camel/providers/local/camel-mbox-summary.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'camel/providers') diff --git a/camel/providers/local/camel-mbox-summary.c b/camel/providers/local/camel-mbox-summary.c index 389b1f356c..5f3691834f 100644 --- a/camel/providers/local/camel-mbox-summary.c +++ b/camel/providers/local/camel-mbox-summary.c @@ -286,10 +286,10 @@ summary_rebuild(CamelMboxSummary *mbs, off_t offset, CamelException *ex) while (camel_mime_parser_step(mp, NULL, NULL) == HSCAN_FROM) { CamelMessageInfo *info; - int pc = (camel_mime_parser_tell(mp)+1) * 100/size; - - camel_operation_progress(NULL, pc); - + off_t pc = camel_mime_parser_tell_start_from (mp) + 1; + + camel_operation_progress (NULL, (int) (((float) pc / size) * 100)); + info = camel_folder_summary_add_from_parser(s, mp); if (info == NULL) { camel_exception_setv(ex, 1, _("Fatal mail parser error near position %ld in folder %s"), @@ -526,7 +526,7 @@ mbox_summary_sync_full(CamelLocalSummary *cls, gboolean expunge, CamelFolderChan count = camel_folder_summary_count(s); for (i = 0; i < count; i++) { - int pc = (i+1)*100/count; + int pc = (i + 1) * 100 / count; camel_operation_progress(NULL, pc); -- cgit