Multiple QofBook support working

Derek Atkins warlord at MIT.EDU
Sun Sep 5 15:19:10 EDT 2004


Excellent!!!  Nice work.  Unfortunately I'm not in a position to even look at it
until Tuesday.

I think that a patch that merges this into the gnucash sources would be
excellent.  Another test-case that would be nice is some way to merge the
Hierarchy Druid into an existing set of accounts.  E.g., add a menu item:

   File -> Add New Account Hierarchy

or something like that..  It would pull up the hierarchy druid and let the user
add more accounts to their datafile by merging it in using your new code.

As for whether to combine this with your previous patch....  Sure, go ahead. 
You seem to imply that it's only a small change to the existing files. 
However, I wont be able to do anything with your existing patch until at least
Tuesday, so unless Linas wants to apply it I wont be able to get to it until at
least then.

Linas:  Feel free to apply Neil's patch if you have the chance before Monday
Night, otherwise I'll look at it mid-week and try to get it applied.

-derek

Quoting Neil Williams <linux at codehelp.co.uk>:

> 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/
> 

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available



More information about the gnucash-devel mailing list