[Gnucash-changes] r13544 - gnucash/trunk - Remove extra events added in r13483. This leaves the REMOVE event as

David Hampton hampton at cvs.gnucash.org
Wed Mar 8 19:49:46 EST 2006


Author: hampton
Date: 2006-03-08 19:49:46 -0500 (Wed, 08 Mar 2006)
New Revision: 13544
Trac: http://svn.gnucash.org/trac/changeset/13544

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/engine/Account.c
   gnucash/trunk/src/engine/Group.c
   gnucash/trunk/src/gnome-utils/gnc-tree-model-account.c
Log:
Remove extra events added in r13483.  This leaves the REMOVE event as
the only changed event.


Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-03-08 21:22:40 UTC (rev 13543)
+++ gnucash/trunk/ChangeLog	2006-03-09 00:49:46 UTC (rev 13544)
@@ -1,3 +1,10 @@
+2006-03-08  David Hampton  <hampton at employees.org>
+
+	* src/gnome-utils/gnc-tree-model-account.c:
+	* src/engine/Account.c:
+	* src/engine/Group.c: Remove extra events added in r13483.  This
+	leaves the REMOVE event as the only changed event.
+
 2006-03-08  Derek Atkins  <derek at ihtfp.com>
 
 	* src/engine/gnc-filepath-utils.c:

Modified: gnucash/trunk/src/engine/Account.c
===================================================================
--- gnucash/trunk/src/engine/Account.c	2006-03-08 21:22:40 UTC (rev 13543)
+++ gnucash/trunk/src/engine/Account.c	2006-03-09 00:49:46 UTC (rev 13544)
@@ -316,16 +316,8 @@
 
 static inline void on_done(QofInstance *inst) 
 {
-    GncEventData ed;
-
     /* old event style */
     gnc_engine_gen_event (&inst->entity, GNC_EVENT_MODIFY);
-
-    /* new event style */
-    ed.node = inst;
-    ed.idx = 0;
-    qof_event_gen(&inst->entity, QOF_EVENT_MODIFY, &ed);
-
 }
 
 static inline void on_err (QofInstance *inst, QofBackendError errcode)
@@ -902,7 +894,6 @@
   gnc_numeric  reconciled_balance;
   Split *last_split = NULL;
   GList *lp;
-  GncEventData ed;
 
   if (NULL == acc) return;
   if (acc->inst.editlevel > 0) return;
@@ -948,9 +939,6 @@
 
   acc->balance_dirty = FALSE;
 
-  ed.node = acc;
-  ed.idx = 0;
-  qof_event_gen(&acc->inst.entity, QOF_EVENT_MODIFY, &ed);
   gnc_engine_gen_event (&acc->inst.entity, GNC_EVENT_MODIFY);
 }
 

Modified: gnucash/trunk/src/engine/Group.c
===================================================================
--- gnucash/trunk/src/engine/Group.c	2006-03-08 21:22:40 UTC (rev 13543)
+++ gnucash/trunk/src/engine/Group.c	2006-03-09 00:49:46 UTC (rev 13544)
@@ -641,8 +641,6 @@
     return;
   }
 
-  gnc_engine_gen_event (&acc->inst.entity, GNC_EVENT_REMOVE);
-
   acc->parent = NULL;
 
   /* Gather event data */
@@ -706,8 +704,6 @@
 void
 xaccGroupInsertAccount (AccountGroup *grp, Account *acc)
 {
-  GncEventData ed;
-
   if (!grp || !grp->book) return;
   if (!acc) return;
 
@@ -760,9 +756,6 @@
                                           group_sort_helper);
 
     /* Gather event data */
-    ed.node = acc;
-    ed.idx = 0;
-    qof_event_gen(&acc->inst.entity, QOF_EVENT_ADD, &ed);
     gnc_engine_gen_event (&acc->inst.entity, GNC_EVENT_ADD);
 
     acc->inst.dirty = TRUE;

Modified: gnucash/trunk/src/gnome-utils/gnc-tree-model-account.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-model-account.c	2006-03-08 21:22:40 UTC (rev 13543)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-model-account.c	2006-03-09 00:49:46 UTC (rev 13544)
@@ -1445,7 +1445,8 @@
   Account *account, *parent;
 
   g_return_if_fail(model);	/* Required */
-  if (!ed) return;		/* Required for us. Not always sent. */
+  if (!GNC_IS_ACCOUNT(entity))
+    return;
 
   ENTER("entity %p of type %d, model %p, event_data %p",
 	entity, event_type, model, ed);
@@ -1455,7 +1456,7 @@
   switch (event_type) {
     case QOF_EVENT_ADD:
       /* Tell the filters/views where the new account was added. */
-      account = GNC_ACCOUNT(ed->node);
+      account = GNC_ACCOUNT(entity);
       DEBUG("add account %p (%s)", account, xaccAccountGetName(account));
       path = gnc_tree_model_account_get_path_from_account(model, account);
       if (!path) {
@@ -1472,6 +1473,8 @@
       break;
 
     case QOF_EVENT_REMOVE:
+      if (!ed) /* Required for a remove. */
+	break;
       parent = ed->node ? GNC_ACCOUNT(ed->node) : priv->toplevel;
       parent_name = ed->node ? xaccAccountGetName(parent) : "Root";
       DEBUG("remove child %d of account %p (%s)", ed->idx, parent, parent_name);
@@ -1486,7 +1489,7 @@
       break;
 
     case QOF_EVENT_MODIFY:
-      account = GNC_ACCOUNT(ed->node);
+      account = GNC_ACCOUNT(entity);
       DEBUG("modify  account %p (%s)", account, xaccAccountGetName(account));
       path = gnc_tree_model_account_get_path_from_account(model, account);
       if (!path) {



More information about the gnucash-changes mailing list