[Gnucash-changes] r13351 - gnucash/trunk/lib/libqof/qof - Mark the QofCollection as dirty when a new QofEntity is added or removed.

Derek Atkins warlord at MIT.EDU
Tue Feb 21 16:55:44 EST 2006


I'm not convinced this patch is correct..  If the QofInstance is instantly
saved (ala SQL) then it's unclear that the collection dirty flag is
properly cleared.  That's why the qof collection dirty flag is usually
inherited from the objects in the collection.

-derek

Quoting Chris Shoemaker <chris at cvs.gnucash.org>:

> Author: chris
> Date: 2006-02-21 16:46:07 -0500 (Tue, 21 Feb 2006)
> New Revision: 13351
> Trac: http://svn.gnucash.org/trac/changeset/13351
>
> Modified:
>   gnucash/trunk/lib/libqof/qof/qofid.c
> Log:
>   Mark the QofCollection as dirty when a new QofEntity is added or removed.
>
>
> Modified: gnucash/trunk/lib/libqof/qof/qofid.c
> ===================================================================
> --- gnucash/trunk/lib/libqof/qof/qofid.c	2006-02-21 21:44:42 UTC (rev 13350)
> +++ gnucash/trunk/lib/libqof/qof/qofid.c	2006-02-21 21:46:07 UTC (rev 13351)
> @@ -182,6 +182,7 @@
>   col = ent->collection;
>   if (!col) return;
>   g_hash_table_remove (col->hash_of_entities, &ent->guid);
> +  qof_collection_mark_dirty(col);
>   ent->collection = NULL;
> }
>
> @@ -193,6 +194,7 @@
>   g_return_if_fail (col->e_type == ent->e_type);
>   qof_collection_remove_entity (ent);
>   g_hash_table_insert (col->hash_of_entities, &ent->guid, ent);
> +  qof_collection_mark_dirty(col);
>   ent->collection = col;
> }
>
> @@ -208,6 +210,7 @@
> 	e = qof_collection_lookup_entity(coll, &ent->guid);
> 	if ( e != NULL ) { return FALSE; }
> 	g_hash_table_insert (coll->hash_of_entities, &ent->guid, ent);
> +	qof_collection_mark_dirty(coll);
> 	return TRUE;
> }
>
>
> _______________________________________________
> gnucash-changes mailing list
> gnucash-changes at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-changes
>



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