Fix example account handling in hierarchy druid
Neil Williams
linux at codehelp.co.uk
Fri Oct 22 15:42:39 EDT 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I've worked out why the merge druid was finding so many collisions. By using
some test code (since removed) to create a simple
qof_object_foreach("Account",gnc_get_current_book(),test_cb,NULL);
and test_cb which simply counted the number of discrete Account entities. i.e.
these are real accounts with GUID's, I got:
Prior to running the hierarchy druid, 0 accounts exist
Prior to initialising the Book Merge, 472 accounts exist
druid-merge new code
Prior to the Book Merge Commit, 472 accounts already exist
After the commit, the merge book contains, 472 accounts
In the final target book, 477 accounts exist
This was a run that started with a dummy book that only had two accounts,
Expense and Childcare. I selected Car Loan from the hierarchy druid and apart
from these calls, the code is as CVS HEAD. e.g
counter = 0;
qof_object_foreach("Account",gnc_get_current_book(),test_cb,NULL);
g_message("Prior to the Book Merge Commit, %i accounts already exist",
counter);
The number of accounts is zero prior to the hierarchy druid because the first
count was taken just after the second session had been started.
The fault lay in the example account read that loaded the entire example
account directory into the gnc_get_current_book. I've created a temporary
book and the selected accounts are now the only ones to appear in the real
session book.
This has been tested in a fresh build from CVS HEAD and with both the merge
druid and File -> New File for the hierarchy druid alone. It didn't show up
in previous tests because in the rest of the engine, accounts without an
account group just got ignored, although they would persist until a new file
was opened or the user quit.
- --
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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
iD8DBQFBeWK8iAEJSii8s+MRAqXzAJwLUXsO0We9uouVMkuylzBbQ1GA/wCfX4nv
R3j5qNt0/SNoc7gnOlnieGU=
=IUzl
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Oct-22-04.patch
Type: text/x-diff
Size: 140897 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-patches/attachments/20041022/e75f6c3c/Oct-22-04-0001.bin
More information about the gnucash-patches
mailing list