[Gnucash-changes] r13132 - gnucash/trunk/src/engine - Keep QOF aware of the dirty-state of Transactions.

Chris Shoemaker c.shoemaker at cox.net
Mon Feb 6 13:30:10 EST 2006


On Mon, Feb 06, 2006 at 01:11:31PM -0500, Derek Atkins wrote:
> Quoting Chris Shoemaker <c.shoemaker at cox.net>:
> 
> >On Mon, Feb 06, 2006 at 01:03:43PM -0500, Derek Atkins wrote:
> >>mark_trans() should call qof_instance_set_dirty().  no need to call it
> >>everywhere -- we already call mark_trans() everywhere.  Do this all in
> >>one place, please.
> >
> >Actually, we call mark_trans() in only two places.  It seems like
> >mark_trans() is for dirtying the splits in the trans, not the trans
> >itself.
> 
> Hmm..  I'm thinking we might want to consolidate some.  There's lots of
> places where we want to mark the transaction dirty, notify QOF, and send
> an event.  This should all be done in one function and that function
> should be called everywhere.

mark_trans() is horribly named.  It's a fundamentally different
operation than qof_instance_set_dirty().  _Most_ of the places we call
qof_instance_dirty (11 of them) we don't really want to dirty the
splits.  

> On a separate (but related) note, I want to separate extend the events
> in order to differentiate between "Account data modified" and "account
> contents modified" -- where the former is emitted by the new/edit account
> dialog, and the latter is emitted by the register...   

Absolutely, and this is _very_ related, because the same case applies
to Transactions.  The mark_trans() cases should correlate with
emitting the "child_changed" signal (or whatever), while the
qof_instance_set_dirty() cases should correlate with emitting just the
"changed" signal (or whatever).  And in two places, we should emit both.

This is a very useful distinction for both Accounts and Transactions.

-chris

> I just haven't
> gone through to handle this yet -- I'm going to have to go through the
> code and find every place the account events are used and check them.
> Blah.
> 
> -derek
> 
> -- 
>       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