gnucash maint: Multiple changes pushed

Christopher Lam clam at code.gnucash.org
Tue Sep 15 06:37:55 EDT 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/7152b26e (commit)
	 via  https://github.com/Gnucash/gnucash/commit/683fe2f3 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/0d10d1e2 (commit)
	from  https://github.com/Gnucash/gnucash/commit/f0341cdd (commit)



commit 7152b26ede73595685fe2772eab27da82fb91060
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Tue Sep 15 09:26:35 2020 +0800

    [reports] pulse progress bar in common html-object renderer code
    
    ... instead of individual html-object renderers as in 63ec05d0d. We
    can also increase pulse tempo (from 2500 calls to 1000 calls) without
    significantly affecting performance.

diff --git a/gnucash/report/html-document.scm b/gnucash/report/html-document.scm
index be2c95929..575cb57df 100644
--- a/gnucash/report/html-document.scm
+++ b/gnucash/report/html-document.scm
@@ -141,8 +141,7 @@
           ;; now render the children
           (for-each
            (lambda (child)
-               (push (gnc:html-object-render child doc))
-               (gnc:pulse-progress-bar))
+               (push (gnc:html-object-render child doc)))
            objs)
 
           (when headers?
@@ -331,6 +330,7 @@
        (gnc:html-document-render-data doc obj)) obj))))
 
 (define (gnc:html-object-render obj doc)
+  (gnc:pulse-progress-bar)
   (if (gnc:html-object? obj)
       ((gnc:html-object-renderer obj) (gnc:html-object-data obj) doc)
       (let ((htmlo (gnc:make-html-object obj)))
diff --git a/gnucash/report/html-table.scm b/gnucash/report/html-table.scm
index be1af8d14..40e12d7ec 100644
--- a/gnucash/report/html-table.scm
+++ b/gnucash/report/html-table.scm
@@ -168,7 +168,6 @@
            (format #f "colspan=\"~a\"" (gnc:html-table-cell-colspan cell))))
     (for-each
      (lambda (child)
-       (gnc:pulse-progress-bar)
        (push (gnc:html-object-render child doc)))
      cell-data)
     (push (gnc:html-document-markup-end doc cell-tag))
@@ -476,7 +475,6 @@
           (push (gnc:html-document-markup-end doc rowmarkup))
           (when rowstyle (gnc:html-document-pop-style doc))
 
-          (gnc:pulse-progress-bar)
           (rowloop (cdr rows) (1+ rownum)))))
     (push (gnc:html-document-markup-end doc "tbody"))
 
diff --git a/gnucash/report/html-text.scm b/gnucash/report/html-text.scm
index 67c2c4172..94a04d420 100644
--- a/gnucash/report/html-text.scm
+++ b/gnucash/report/html-text.scm
@@ -202,7 +202,6 @@
     (gnc:html-document-push-style doc (gnc:html-text-style p))
     (for-each 
      (lambda (elt)
-       (gnc:pulse-progress-bar)
        (cond ((procedure? elt)
               (push (elt doc)))
              (#t 
diff --git a/gnucash/report/report-utilities.scm b/gnucash/report/report-utilities.scm
index db35fad1a..7b60a060a 100644
--- a/gnucash/report/report-utilities.scm
+++ b/gnucash/report/report-utilities.scm
@@ -633,7 +633,7 @@ query instead.")
   (let ((pulse-idx 0))
     (lambda ()
       (set! pulse-idx (1+ pulse-idx))
-      (when (= pulse-idx 2500)
+      (when (= pulse-idx 1000)
         (set! pulse-idx 0)
         (gnc-window-show-progress "" 105)))))
 

commit 683fe2f37ebd49ce139db63936bb2cd1fd932eab
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Tue Sep 15 10:16:52 2020 +0800

    [trep-engine] test void status without merging another query
    
    * use bitwise logic to combine reconcile filter and void filter --
      they use the same "reconciled" data field
    
    * deprecate single-use functions in report-utilities.scm

diff --git a/gnucash/report/report-utilities.scm b/gnucash/report/report-utilities.scm
index 90a064717..db35fad1a 100644
--- a/gnucash/report/report-utilities.scm
+++ b/gnucash/report/report-utilities.scm
@@ -573,6 +573,9 @@
 
 ;; utility function - ensure that a query matches only non-voids.  Destructive.
 (define (gnc:query-set-match-non-voids-only! query book)
+  (issue-deprecation-warning
+   "gnc:query-set-match-non-voids-only! is deprecated. add query for\
+(logand CLEARED-ALL (lognot CLEARED-VOIDED)) instead.")
   (let ((temp-query (qof-query-create-for-splits)))
     (qof-query-set-book temp-query book)
 
@@ -589,6 +592,9 @@
 ;; utility function - ensure that a query matches only voids.  Destructive
 
 (define (gnc:query-set-match-voids-only! query book)
+  (issue-deprecation-warning
+   "gnc:query-set-match-non-voids-only! is deprecated. add CLEARED-VOIDED \
+query instead.")
   (let ((temp-query (qof-query-create-for-splits)))
     (qof-query-set-book temp-query book)
 
diff --git a/gnucash/report/trep-engine.scm b/gnucash/report/trep-engine.scm
index 0f0dde71f..87613cc06 100644
--- a/gnucash/report/trep-engine.scm
+++ b/gnucash/report/trep-engine.scm
@@ -352,14 +352,17 @@ in the Options panel."))
 (define show-void-list
   (list
    (list 'non-void-only
+         (cons 'how (logand CLEARED-ALL (lognot CLEARED-VOIDED)))
          (cons 'text (G_ "Non-void only"))
          (cons 'tip (G_ "Show only non-voided transactions.")))
 
    (list 'void-only
+         (cons 'how CLEARED-VOIDED)
          (cons 'text (G_ "Void only"))
          (cons 'tip (G_ "Show only voided transactions.")))
 
    (list 'both
+         (cons 'how CLEARED-ALL)
          (cons 'text (G_ "Both"))
          (cons 'tip (G_ "Show both (and include void transactions in totals).")))))
 
@@ -389,7 +392,7 @@ in the Options panel."))
    (list 'all
          (cons 'text (G_ "All"))
          (cons 'tip (G_ "Show All Transactions"))
-         (cons 'filter-types #f))
+         (cons 'filter-types CLEARED-ALL))
 
    (list 'unreconciled
          (cons 'text (G_ "Unreconciled"))
@@ -2023,10 +2026,12 @@ warning will be removed in GnuCash 5.0"))
                    'no-guile-regex-support)))
          (transaction-filter-exclude?
           (opt-val pagename-filter optname-transaction-matcher-exclude))
-         (reconcile-status-filter
-          (keylist-get-info reconcile-status-list
-                            (opt-val pagename-filter optname-reconcile-status)
-                            'filter-types))
+         (void-filter (opt-val pagename-filter optname-void-transactions))
+         (reconcile-filter (opt-val pagename-filter optname-reconcile-status))
+         (cleared-filter
+          (logand
+           (keylist-get-info reconcile-status-list reconcile-filter 'filter-types)
+           (keylist-get-info show-void-list void-filter 'how)))
          (report-title (opt-val gnc:pagename-general gnc:optname-reportname))
          (primary-key (opt-val pagename-sorting optname-prime-sortkey))
          (primary-order (opt-val pagename-sorting optname-prime-sortorder))
@@ -2034,7 +2039,6 @@ warning will be removed in GnuCash 5.0"))
          (secondary-key (opt-val pagename-sorting optname-sec-sortkey))
          (secondary-order (opt-val pagename-sorting optname-sec-sortorder))
          (secondary-date-subtotal (opt-val pagename-sorting optname-sec-date-subtotal))
-         (void-status (opt-val pagename-filter optname-void-transactions))
          (closing-match (keylist-get-info
                          show-closing-list
                          (opt-val pagename-filter optname-closing-transactions)
@@ -2148,16 +2152,9 @@ warning will be removed in GnuCash 5.0"))
      (else
       (qof-query-set-book query (gnc-get-current-book))
       (xaccQueryAddAccountMatch query c_account_1 QOF-GUID-MATCH-ANY QOF-QUERY-AND)
+      (xaccQueryAddClearedMatch query cleared-filter QOF-QUERY-AND)
       (unless split->date
         (xaccQueryAddDateMatchTT query #t begindate #t enddate QOF-QUERY-AND))
-      (case void-status
-        ((non-void-only)
-         (gnc:query-set-match-non-voids-only! query (gnc-get-current-book)))
-        ((void-only)
-         (gnc:query-set-match-voids-only! query (gnc-get-current-book)))
-        (else #f))
-      (when reconcile-status-filter
-        (xaccQueryAddClearedMatch query reconcile-status-filter QOF-QUERY-AND))
       (when (boolean? closing-match)
         (xaccQueryAddClosingTransMatch query closing-match QOF-QUERY-AND))
       (unless custom-sort?

commit 0d10d1e2347322f483c5890934198e27c5a05bb1
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Tue Sep 15 10:16:25 2020 +0800

    [engine.i] swigify CLEARED-ALL
    
    to be used by trep-engine.scm

diff --git a/bindings/engine.i b/bindings/engine.i
index 5ff358ac7..89803bbc4 100644
--- a/bindings/engine.i
+++ b/bindings/engine.i
@@ -361,6 +361,7 @@ void qof_book_set_string_option(QofBook* book, const char* opt_name, const char*
     SET_ENUM("CLEARED-FROZEN");
     SET_ENUM("CLEARED-RECONCILED");
     SET_ENUM("CLEARED-VOIDED");
+    SET_ENUM("CLEARED-ALL");
 
     SET_ENUM("HOOK-REPORT");
     SET_ENUM("HOOK-SAVE-OPTIONS");



Summary of changes:
 bindings/engine.i                   |  1 +
 gnucash/report/html-document.scm    |  4 ++--
 gnucash/report/html-table.scm       |  2 --
 gnucash/report/html-text.scm        |  1 -
 gnucash/report/report-utilities.scm |  8 +++++++-
 gnucash/report/trep-engine.scm      | 25 +++++++++++--------------
 6 files changed, 21 insertions(+), 20 deletions(-)



More information about the gnucash-changes mailing list