r20103 - gnucash/trunk/src/libqof/qof - Add a read-only attribute to QofBook and check of same to

John Ralls jralls at code.gnucash.org
Fri Jan 14 18:25:28 EST 2011


Author: jralls
Date: 2011-01-14 18:25:27 -0500 (Fri, 14 Jan 2011)
New Revision: 20103
Trac: http://svn.gnucash.org/trac/changeset/20103

Added:
   gnucash/trunk/src/libqof/qof/test/
   gnucash/trunk/src/libqof/qof/test/Makefile.am
   gnucash/trunk/src/libqof/qof/test/test-qof.c
   gnucash/trunk/src/libqof/qof/test/test-qofbackend.c
   gnucash/trunk/src/libqof/qof/test/test-qofbook.c
   gnucash/trunk/src/libqof/qof/test/test-qofinstance.c
   gnucash/trunk/src/libqof/qof/test/test-qofsession.c
Modified:
   gnucash/trunk/src/libqof/qof/Makefile.am
   gnucash/trunk/src/libqof/qof/qofbackend-p.h
   gnucash/trunk/src/libqof/qof/qofbackend.c
   gnucash/trunk/src/libqof/qof/qofbackend.h
   gnucash/trunk/src/libqof/qof/qofbook.c
   gnucash/trunk/src/libqof/qof/qofbook.h
   gnucash/trunk/src/libqof/qof/qofinstance.c
   gnucash/trunk/src/libqof/qof/qofsession.c
   gnucash/trunk/src/libqof/qof/qofsession.h
Log:
Add a read-only attribute to QofBook and check of same to 
qof_instance_begin_edit. Add qof_session_safe_save. Add unit tests for 
these changes.

QofBook read-only attribute is to prevent starting an edit when the 
version of Gnucash which created a dataset is newer than the one 
currently running. This is to prevent writing records of an old format 
into an existing data set. The user can use File>Save As to create a new 
QofSession which will write a completely new dataset in the current 
format. This is an important safety feature for future versions of 
Gnucash which will not bring all of a dataset into memory, instead 
loading only what is immediately needed.

Safe-save is the Qof access to allow writing out a dataset to an 
existing server database (i.e., postgresql or mysql) while maintaining 
the ability to both transaction-protect saving individual records while 
maintaining the ability to rollback the entire save if something goes 
wrong.

The unit test framework is added to enable testing these components. 
More tests will be added in a later commit.





More information about the gnucash-patches mailing list