r16811 - gnucash/branches/2.2/src/report/report-system - [r16804] prepare report system to handle newer reports in case user downgrades from > 2.2.x

Andreas Köhler andi5 at cvs.gnucash.org
Sat Jan 5 11:12:50 EST 2008


Author: andi5
Date: 2008-01-05 11:12:50 -0500 (Sat, 05 Jan 2008)
New Revision: 16811
Trac: http://svn.gnucash.org/trac/changeset/16811

Modified:
   gnucash/branches/2.2/src/report/report-system/report-system.scm
   gnucash/branches/2.2/src/report/report-system/report.scm
Log:
[r16804] 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.

Committed by andrewsw.


Modified: gnucash/branches/2.2/src/report/report-system/report-system.scm
===================================================================
--- gnucash/branches/2.2/src/report/report-system/report-system.scm	2008-01-05 14:34:58 UTC (rev 16810)
+++ gnucash/branches/2.2/src/report/report-system/report-system.scm	2008-01-05 16:12:50 UTC (rev 16811)
@@ -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/branches/2.2/src/report/report-system/report.scm
===================================================================
--- gnucash/branches/2.2/src/report/report-system/report.scm	2008-01-05 14:34:58 UTC (rev 16810)
+++ gnucash/branches/2.2/src/report/report-system/report.scm	2008-01-05 16:12:50 UTC (rev 16811)
@@ -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