mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[business-core] remove gnc:split->owner
This commit is contained in:
@@ -30,7 +30,6 @@
|
||||
(export gnc:owner-get-address-dep)
|
||||
(export gnc:owner-get-name-and-address-dep)
|
||||
(export gnc:owner-get-owner-id)
|
||||
(export gnc:split->owner)
|
||||
(export gnc:make-split->owner)
|
||||
|
||||
(define (gnc:owner-get-address owner)
|
||||
@@ -105,30 +104,6 @@
|
||||
(gnc:owner-get-owner-id (gncJobGetOwner (gncOwnerGetJob owner))))
|
||||
(else ""))))
|
||||
|
||||
;; this function aims to find a split's owner. It will allocate and
|
||||
;; memoize (cache) the owners because gncOwnerGetOwnerFromLot is
|
||||
;; slow. after use, it must be called with #f to free the owners.
|
||||
(define gnc:split->owner
|
||||
(let ((ht (make-hash-table)))
|
||||
(lambda (split)
|
||||
(issue-deprecation-warning
|
||||
"gnc:split->owner is deprecated in 4.x. use gnc:make-split->owner instead.")
|
||||
(cond
|
||||
((not split)
|
||||
(hash-for-each (lambda (k v) (gncOwnerFree v)) ht)
|
||||
(hash-clear! ht))
|
||||
((hash-ref ht (gncSplitGetGUID split)) => identity)
|
||||
(else
|
||||
(let ((lot (xaccSplitGetLot split))
|
||||
(owner (gncOwnerNew)))
|
||||
(unless (gncOwnerGetOwnerFromLot lot owner)
|
||||
(gncOwnerCopy (gncOwnerGetEndOwner
|
||||
(gncInvoiceGetOwner
|
||||
(gncInvoiceGetInvoiceFromLot lot)))
|
||||
owner))
|
||||
(hash-set! ht (gncSplitGetGUID split) owner)
|
||||
owner))))))
|
||||
|
||||
(define owner-guardian (make-guardian))
|
||||
|
||||
(define (reclaim-owners)
|
||||
|
||||
Reference in New Issue
Block a user