Multiple QofBook support working
Neil Williams
linux at codehelp.co.uk
Sun Sep 5 13:49:29 EDT 2004
Using QofSession, I've now got the example program to load two external XML
files, create two separate QofBook structures in memory, access both
simultaneously, compare the QofBook contents and merge the two QofBooks,
complete with user-intervention and collision handling.
http://www.codehelp.co.uk/code/index.html
http://www.codehelp.co.uk/code/example-gncBookMerge.c
http://www.codehelp.co.uk/code/druid-business.gnc
http://www.codehelp.co.uk/code/druid-simple.gnc
The gnc files I've chosen were created with the New File druid in GnuCash
1.8.9 (on MacOSX) - as indicated by the names, one is a simple checkbook
choice, the other a more complex business choice with multiple selections in
the druid.
There's more to do with the code to better support books with lots of user
data, but it's coming along. On my lowly PIII 700MHz system with not a lot of
free memory, it takes <3 seconds to bring up the user intervention
information - that's loading the engine, the two files, all the comparisons
and the bulk of the total merge workload. Previous problems with GncCommodity
and GncPriceDB are now handled gracefully - until these use QofEntity and
GUID, they are silently ignored by the merge.
example-gncBookMerge is now capable of loading, comparing and merging simple
external QofBooks.
Usage:
cd gnucash/src/engine/test
<path to installed CVS
head>/libexec/overrides/gnucash-env ./example-gncBookMerge
(Execute in the local directory, in order for the example to locate the
demo GnuCash XML files)
There are small changes to qof_book_merge.c and qof_book_merge.h from the
patch I sent in on Fri, 27 Aug 2004 but the main changes are all in
example-gncBookMerge.c
Shall I wrap the new code into a new patch that encompasses old and new, or is
the older patch soon to be committed?
The modified qof_book_merge.c and qof_book_merge.h have been committed to QOF
CVS at SourceForge. Should show up in the WWW browse info in 24hrs.
http://sourceforge.net/projects/qof
http://cvs.sourceforge.net/viewcvs.py/qof/qof/qof/
All the code is also available at codehelp.co.uk/code/
--
Neil Williams
=============
http://www.codehelp.co.uk/
http://www.dclug.org.uk/
http://www.isbn.org.uk/
http://sourceforge.net/projects/isbnsearch/
http://www.biglumber.com/x/web?qs=0x8801094A28BCB3E3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20040905/f4575fbf/attachment.bin
More information about the gnucash-devel
mailing list