On Wednesday 20 July 2005 7:28 pm, Neil Williams wrote:
> OK, all I need now is the time to replace every obj->inst.dirty = TRUE with
> qof_instance_set_dirty((QofInstance*)obj)
>
> :-(
>
> void qof_instance_set_dirty(QofInstance* inst)
> {
>       QofBook *book;
>       QofCollection *coll;
>       QofEntity *ent;
>
>       inst->dirty = TRUE;
>       ent = inst->entity;

ent = &inst->entity;  /* :-) */

>       book = qof_instance_get_book(inst);
>       coll = qof_book_get_collection(book, ent->e_type);
>       qof_collection_mark_dirty(coll);
> }

That function will be in my next commit (which isn't due particularly soon).

> Then replace every is_dirty = NULL with
> is_dirty = qof_collection_is_dirty

and make_clean = NULL with make_clean = qof_collection_make_clean

When a collection is marked clean, does THAT have to iterate down to every 
instance? So far, I've avoided anything that requires iteration over every 
single instance for this task. It's only the collection that is actually 
monitored for being dirty. It seems pointless to check every instance when 
only one instance may have caused the collection to be marked as dirty. It's 
very quick to code this in but it could add a noticeable delay on Save.

-- 

Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

Attachment: pgpwpz3zdqhmF.pgp
Description: PGP signature

_______________________________________________
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

Reply via email to