Welcome back

Neil Williams linux at codehelp.co.uk
Thu Aug 19 16:28:31 EDT 2004


On Wednesday 18 August 2004 3:10, Linas Vepstas wrote:
> The GUI that uses book-merge needs to make a copy of the book first.
> If the merge is aborted mid-way, you still have a copy of the original.
> Yes, this sounds cpu-sucking to me.   And we don't have an
> infrastructure for making copies at this time.  So we'd need to deal
> with that ...

From the backend docs:
"In the current design, a session may hold multiple books. For now, exactly 
what this means is somewhat vague, and code in various places makes some 
implicit assumptions: first, only one book is 'current' and open for editing. 
Next, its assumed that all of the books in a session are related in some 
way."

So using two unrelated books in the same session is going to possibly generate 
problems based in backend assumptions about relationships between the books, 
OK.

What about : 

QofSession *s1 = qof_session_new();
QofBook *targetBook = qof_book_new();
qof_session_begin ( s1, targetBook, "target_id", FALSE, FALSE);
// so far, simulating what happens already?
// then add:
QofSession *s2 = qof_session_new();
QofBook *importBook = qof_book_new();
qof_session_begin ( s2, importBook, "import_id", FALSE, FALSE);
qof_session_swap_data(s2, s1);
qof_session_end (s2);

Would this give access to targetBook read-write and importBook read-only?

importBook wouldn't necessarily need to be queried via the session, just 
initialised from a filesource. I just need a valid QofBook pointer to the 
structure filled by the test file.

Even if this may cause problems after the merge, is this a possibility for 
testing a merge with two real files? i.e. in local code that never gets into 
CVS?

(I can't do a lot more with the merge code until I can test it to breaking 
point, time and again, with real data.)

-- 

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: signature
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20040819/4dfe9f81/attachment.bin


More information about the gnucash-devel mailing list