[Gnucash-changes] r13958 - gnucash/trunk/src/engine - Remove some unnecessary calls to xaccGroupMarkNotSaved() which were

Chris Shoemaker chris at cvs.gnucash.org
Mon May 8 00:56:18 EDT 2006


Author: chris
Date: 2006-05-08 00:56:17 -0400 (Mon, 08 May 2006)
New Revision: 13958
Trac: http://svn.gnucash.org/trac/changeset/13958

Modified:
   gnucash/trunk/src/engine/Split.c
   gnucash/trunk/src/engine/Transaction.c
Log:
   Remove some unnecessary calls to xaccGroupMarkNotSaved() which were 
   dirtying the book implicitly without setting any time of first change.
   Instead, make sure that committed Splits dirty their parent Transaction.


Modified: gnucash/trunk/src/engine/Split.c
===================================================================
--- gnucash/trunk/src/engine/Split.c	2006-05-08 04:47:04 UTC (rev 13957)
+++ gnucash/trunk/src/engine/Split.c	2006-05-08 04:56:17 UTC (rev 13958)
@@ -512,8 +512,6 @@
         GList *node = g_list_find (orig_acc->splits, s);
         if (node) {
             orig_acc->splits = g_list_delete_link (orig_acc->splits, node);
-            //FIXME: probably not needed.
-            xaccGroupMarkNotSaved (orig_acc->parent);
             //FIXME: find better event type
             qof_event_gen (&orig_acc->inst.entity, QOF_EVENT_MODIFY, NULL);
 	    // And send the account-based event, too
@@ -539,7 +537,6 @@
             if (s->lot && (NULL == s->lot->account))
                 xaccAccountInsertLot (acc, s->lot);
 
-            xaccGroupMarkNotSaved (acc->parent); //FIXME: probably not needed.
             //FIXME: find better event
             qof_event_gen (&acc->inst.entity, QOF_EVENT_MODIFY, NULL);
 
@@ -568,6 +565,9 @@
     s->orig_parent = s->parent;
     qof_instance_mark_clean(QOF_INSTANCE(s));
 
+    /* This is because Splits don't call qof_commit_edit(). */
+    qof_instance_set_dirty(QOF_INSTANCE(s->parent));
+
     mark_acc(acc);
     xaccAccountRecomputeBalance(acc);
     if (s->inst.do_free)

Modified: gnucash/trunk/src/engine/Transaction.c
===================================================================
--- gnucash/trunk/src/engine/Transaction.c	2006-05-08 04:47:04 UTC (rev 13957)
+++ gnucash/trunk/src/engine/Transaction.c	2006-05-08 04:56:17 UTC (rev 13958)
@@ -219,10 +219,8 @@
     Account *account = s->acc;
     GNCLot *lot = s->lot;
     if (account)
-    {
-      xaccGroupMarkNotSaved (account->parent);
       qof_event_gen (&account->inst.entity, GNC_EVENT_ITEM_CHANGED, s);
-    }
+
     if (lot)
     {
       /* A change of transaction date might affect opening date of lot */
@@ -867,9 +865,7 @@
     if (s->gains_split && (GAINS_STATUS_GAINS & s->gains_split->gains))
     {
       Transaction *t = s->gains_split->parent;
-      xaccTransBeginEdit (t);
       xaccTransDestroy (t);
-      xaccTransCommitEdit (t);
       s->gains_split = NULL;
     }
   }



More information about the gnucash-changes mailing list