AUDIT: r16804 - gnucash/trunk/src/report/report-system - prepare report system to handle newer reports in case user downgrades from > 2.2.x
Andrew Sackville-West
andrewsw at cvs.gnucash.org
Sat Jan 5 01:10:31 EST 2008
Author: andrewsw
Date: 2008-01-05 01:10:31 -0500 (Sat, 05 Jan 2008)
New Revision: 16804
Trac: http://svn.gnucash.org/trac/changeset/16804
Modified:
gnucash/trunk/src/report/report-system/report-system.scm
gnucash/trunk/src/report/report-system/report.scm
Log:
prepare report system to handle newer reports in case user downgrades from > 2.2.x
The incoming changes to the report system are not backwards compatible with 2.2 branch. This should allow the
reports opened or saved by the new system to function in 2.2.x.
BP
Modified: gnucash/trunk/src/report/report-system/report-system.scm
===================================================================
--- gnucash/trunk/src/report/report-system/report-system.scm 2008-01-05 03:48:09 UTC (rev 16803)
+++ gnucash/trunk/src/report/report-system/report-system.scm 2008-01-05 06:10:31 UTC (rev 16804)
@@ -106,8 +106,10 @@
(export gnc:define-report)
(export <report>)
(export gnc:report-template-new-options/name)
+(export gnc:report-template-new-options/report-guid)
(export gnc:report-template-menu-name/name)
(export gnc:report-template-renderer/name)
+(export gnc:report-template-renderer/report-guid)
(export gnc:report-template-new-options)
(export gnc:report-template-version)
(export gnc:report-template-name)
@@ -137,6 +139,7 @@
(export gnc:report-set-ctext!)
(export gnc:make-report)
(export gnc:restore-report)
+(export gnc:restore-report-by-guid)
(export gnc:make-report-options)
(export gnc:report-export-types)
(export gnc:report-export-thunk)
Modified: gnucash/trunk/src/report/report-system/report.scm
===================================================================
--- gnucash/trunk/src/report/report-system/report.scm 2008-01-05 03:48:09 UTC (rev 16803)
+++ gnucash/trunk/src/report/report-system/report.scm 2008-01-05 06:10:31 UTC (rev 16804)
@@ -47,7 +47,7 @@
(define <report-template>
(make-record-type "<report-template>"
;; The data items in a report record
- '(version name options-generator
+ '(version name report-guid parent-type options-generator
options-cleanup-cb options-changed-cb
renderer in-menu? menu-path menu-name
menu-tip export-types export-thunk)))
@@ -65,6 +65,8 @@
((record-constructor <report-template>)
#f ;; version
#f ;; name
+ #f ;; report-guid for backwards compat of newer reports
+ #f ;; parent-type for backwards compat of newer reports
#f ;; options-generator
#f ;; options-cleanup-cb
#f ;; options-changed-cb
@@ -138,6 +140,10 @@
(gnc:report-template-new-options templ)
#f)))
+;; dummy function to enable backwards compatibility of newer reports
+(define (gnc:report-template-new-options/report-guid template-id template-name)
+ (gnc:report-template-new-options/name template-name))
+
(define (gnc:report-template-menu-name/name template-name)
(let ((templ (hash-ref *gnc:_report-templates_* template-name)))
(if templ
@@ -151,6 +157,10 @@
(gnc:report-template-renderer templ)
#f)))
+;; dummy function to enable backwards compatibility of newer reports
+(define (gnc:report-template-renderer/report-guid template-id template-name)
+ (gnc:report-template-renderer/name template-name))
+
(define (gnc:report-template-new-options report-template)
(let ((generator (gnc:report-template-options-generator report-template))
(namer
@@ -277,7 +287,11 @@
(gnc-report-add r))
)
+;; dummy function to enable backwards compatibility with newer reports
+(define (gnc:restore-report-by-guid id template-id template-name options)
+ (gnc:restore-report id template-name options))
+
(define (gnc:make-report-options template-name)
(let ((template (hash-ref *gnc:_report-templates_* template-name)))
(if template
More information about the gnucash-changes
mailing list