From f6d34f226f7cc0be8918b48f441ca97da9b98ea0 Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Sun, 6 Sep 2020 22:52:13 +0800 Subject: [PATCH] [Scrub.c] improve responsiveness of progressbar during scrub Formerly would update progress bar every 100 splits. With scrub being slow, it's nicer to update every 10 splits. Also remove the (percentagefunc)(NULL, 0.0) which seems an error -- it would reset the progressbar back to zero immediately. --- libgnucash/engine/Scrub.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libgnucash/engine/Scrub.c b/libgnucash/engine/Scrub.c index 9efb9e93c7..a16c0cf915 100644 --- a/libgnucash/engine/Scrub.c +++ b/libgnucash/engine/Scrub.c @@ -137,7 +137,7 @@ xaccAccountScrubOrphans (Account *acc, QofPercentageFunc percentagefunc) for (node = splits; node; node = node->next) { Split *split = node->data; - if (current_split % 100 == 0) + if (current_split % 10 == 0) { char *progress_msg = g_strdup_printf (message, str, current_split, total_splits); (percentagefunc)(progress_msg, (100 * current_split) / total_splits); @@ -347,7 +347,7 @@ xaccAccountScrubImbalance (Account *acc, QofPercentageFunc percentagefunc) PINFO("Start processing split %d of %d", curr_split_no + 1, split_count); - if (curr_split_no % 100 == 0) + if (curr_split_no % 10 == 0) { char *progress_msg = g_strdup_printf (message, str, curr_split_no, split_count); (percentagefunc)(progress_msg, (100 * curr_split_no) / split_count); @@ -356,7 +356,6 @@ xaccAccountScrubImbalance (Account *acc, QofPercentageFunc percentagefunc) TransScrubOrphansFast (xaccSplitGetParent (split), gnc_account_get_root (acc)); - (percentagefunc)(NULL, 0.0); xaccTransScrubCurrency(trans);