[Commits] [SCM] claws branch, master, updated. 3.15.0-179-gd80cb78

ticho at claws-mail.org ticho at claws-mail.org
Sat Nov 25 00:43:55 CET 2017


The branch, master has been updated
       via  d80cb788fd3a8cfbf8241f02e74a88004a729b9d (commit)
      from  b262ad59f68c298f075ca249c95683e6121fd04c (commit)

Summary of changes:
 src/etpan/nntp-thread.c |   21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)


- Log -----------------------------------------------------------------
commit d80cb788fd3a8cfbf8241f02e74a88004a729b9d
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Nov 25 00:42:34 2017 +0100

    Use statusbar progress meter when opening/refreshing a NNTP folder.

diff --git a/src/etpan/nntp-thread.c b/src/etpan/nntp-thread.c
index cebdf69..26079eb 100644
--- a/src/etpan/nntp-thread.c
+++ b/src/etpan/nntp-thread.c
@@ -48,10 +48,11 @@
 #include "remotefolder.h"
 #include "main.h"
 #include "account.h"
+#include "statusbar.h"
 
 #define DISABLE_LOG_DURING_LOGIN
 
-#define NNTP_BATCH_SIZE 4999
+#define NNTP_BATCH_SIZE 5000
 
 static struct etpan_thread_manager * thread_manager = NULL;
 static chash * nntp_hash = NULL;
@@ -844,10 +845,13 @@ int nntp_threaded_xover(Folder * folder, guint32 beg, guint32 end, struct newsnn
 	 * and to allow updating any progress indicators while we work. */
 	cbeg = beg;
 	while (cbeg <= end && cend <= end) {
-		cend = cbeg + NNTP_BATCH_SIZE;
+		cend = cbeg + (NNTP_BATCH_SIZE - 1);
 		if (cend > end)
 			cend = end;
 
+		statusbar_progress_all(cbeg - beg, end - beg, 1);
+		GTK_EVENTS_FLUSH();
+
 		param.nntp = get_nntp(folder);
 		param.beg = cbeg;
 		param.end = cend;
@@ -875,8 +879,10 @@ int nntp_threaded_xover(Folder * folder, guint32 beg, guint32 end, struct newsnn
 			l = NULL;
 		}
 
-		cbeg += NNTP_BATCH_SIZE + 1;
+		cbeg += NNTP_BATCH_SIZE;
 	}
+
+	statusbar_progress_all(0, 0, 0);
 	
 	debug_print("nntp xover - end\n");
 
@@ -937,10 +943,13 @@ int nntp_threaded_xhdr(Folder * folder, const char *header, guint32 beg, guint32
 	 * and to allow updating any progress indicators while we work. */
 	cbeg = beg;
 	while (cbeg <= end && cend <= end) {
-		cend = cbeg + NNTP_BATCH_SIZE;
+		cend = cbeg + NNTP_BATCH_SIZE - 1;
 		if (cend > end)
 			cend = end;
 
+		statusbar_progress_all(cbeg - beg, end - beg, 1);
+		GTK_EVENTS_FLUSH();
+
 		param.nntp = get_nntp(folder);
 		param.header = header;
 		param.beg = cbeg;
@@ -968,8 +977,10 @@ int nntp_threaded_xhdr(Folder * folder, const char *header, guint32 beg, guint32
 			l = NULL;
 		}
 
-		cbeg += NNTP_BATCH_SIZE + 1;
+		cbeg += NNTP_BATCH_SIZE;
 	}
+
+	statusbar_progress_all(0, 0, 0);
 	
 	debug_print("nntp xhdr %s - end (%d-%d)\n", header, beg, end);
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list