aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camel/ChangeLog9
-rw-r--r--camel/providers/local/camel-mbox-summary.c10
2 files changed, 14 insertions, 5 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 73cc838bb1..f319cd813f 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,14 @@
2001-04-16 Jeffrey Stedfast <fejj@ximian.com>
+ * 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).
+
+2001-04-16 Jeffrey Stedfast <fejj@ximian.com>
+
* camel-operation.c: Added a prototype for stamp().
* camel-charset-map.c (camel_charset_locale_name): #include
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);