3/3 [engine.scm] deprecate scheme utility functions

This commit is contained in:
Christopher Lam 2020-10-30 19:54:06 +08:00
parent 6637d6d210
commit 8628ffa957

View File

@ -81,20 +81,24 @@
;; A few account related utility functions which used to be in engine-utilities.scm
(define (gnc:account-map-descendants thunk account)
(issue-deprecation-warning "gnc:account-map-descendants is deprecated.")
(let ((descendants (or (gnc-account-get-descendants-sorted account) '())))
(map thunk descendants)))
(define (gnc:account-map-children thunk account)
(issue-deprecation-warning "gnc:account-map-children is deprecated.")
(let ((children (or (gnc-account-get-children-sorted account) '())))
(map thunk children)))
;; account related functions
;; helper for sorting of account list
(define (account-full-name<? a b)
(issue-deprecation-warning "account-full-name<? is deprecated. use gnc:account-full-name<? instead.")
(string<? (gnc-account-get-full-name a) (gnc-account-get-full-name b)))
;; return maximum depth over accounts and their children, if any
(define (accounts-get-children-depth accounts)
(issue-deprecation-warning "accounts-get-children-depth is deprecated. use gnc:accounts-get-children-depth instead.")
(apply max
(map (lambda (acct)
(let ((acct-depth (gnc-account-get-current-depth acct)))