pan-devel
[Top][All Lists]
Advanced

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

[Pan-devel] status on loading a group


From: Anatoly Vorobey
Subject: [Pan-devel] status on loading a group
Date: Sun, 6 Jun 2004 23:17:54 +0300
User-agent: Mutt/1.5.4i

Hello,

I'm new here (and a very new user of Pan, which is an awesome program, 
thanks a lot to whoever's listening). Not really familiar with 
the etiquette of the list. Are patches welcome here? 

When loading a large group (>150,000 articles, say) I always experience 
a noticeable delay after the articles are loaded, but before they're 
scored and displayed. During that delay the status item at the bottom of 
the Pan window displays "Loaded X of Y articles", where X will usually 
be less than Y, although the articles have actually all been loaded 
already. Trivial as it is, this irks me, and perhaps I'm not alone in 
this? 

The following simple patch fixes it, and I hope it's considered for 
inclusion. It changes both file_headers_load_group_0140() and 
file_headers_load_group_014090(), both in base/file-headers.c . The 
former function doesn't exhibit this problem, because it has an 
extra status_item_emit_status_va() call after the main loop, added 
no doubt precisely to avoid the situation I described; the latter function 
doesn't have this extra call. I removed the extra call from the first 
function and modified the call inside the loading loop in both 
functions, correcting a trivial off-by-1 error and adding a condition that 
ensures the status is updated right after the last article is loaded.

I compiled with this patch and tested, and it seems to work fine. The 
patch's appended below (it's small), but if that's not a good way 
to submit patches here, please correct me.

Thanks,
Anatoly.

Index: base/file-headers.c
===================================================================
RCS file: /cvs/gnome/pan/pan/base/file-headers.c,v
retrieving revision 1.62
diff -u -r1.62 file-headers.c
--- base/file-headers.c 17 Aug 2003 17:51:34 -0000      1.62
+++ base/file-headers.c 6 Jun 2004 20:07:11 -0000
@@ -294,9 +294,9 @@
                                /* let the user know what we're doing */
                                if (status != NULL) {
                                        status_item_emit_next_step (status);
-                                       if (!(addme->len % 256))
+                                       if (!(addme->len % 256) || (i == qty-1))
                                                status_item_emit_status_va 
(status,
-                                                       _("Loaded %d of %d 
articles"), i, qty);
+                                                       _("Loaded %d of %d 
articles"), i+1, qty);
                                }
 
                                /* add the article to the group if it looks 
sane */
@@ -316,8 +316,6 @@
                                         _("You may want to empty this group 
and download fresh headers."));
                        }
 
-                       status_item_emit_status_va (status, _("Loaded %d of %d 
articles"), i, qty);
-
                        *article_qty = addme->len;
                        group_init_articles (group, addme, status);
                        group->articles_dirty = purged_article_count!=0;
@@ -442,9 +440,9 @@
                                /* let the user know what we're doing */
                                if (status != NULL) {
                                        status_item_emit_next_step (status);
-                                       if (!(addme->len % 512))
+                                       if (!(addme->len % 512) || (i == qty-1))
                                                status_item_emit_status_va 
(status,
-                                                       _("Loaded %d of %d 
articles"), i, qty);
+                                                       _("Loaded %d of %d 
articles"), i+1, qty);
                                }
 
                                /* add the article to the group if it looks 
sane */

-- 
avva




reply via email to

[Prev in Thread] Current Thread [Next in Thread]