[Gnucash-changes] r13758 - gnucash/trunk - Eliminate some unnecessary work by comparing the account name in the

David Hampton hampton at cvs.gnucash.org
Sat Apr 8 19:52:20 EDT 2006


Author: hampton
Date: 2006-04-08 19:52:20 -0400 (Sat, 08 Apr 2006)
New Revision: 13758
Trac: http://svn.gnucash.org/trac/changeset/13758

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/gnome-utils/account-quickfill.c
Log:
Eliminate some unnecessary work by comparing the account name in the
quickfill with the actual account name, and only rebuilding the
quickfill if they differ.  This improves GnuCash's response somewhat,
but still needs more improvement.


Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-04-08 22:50:08 UTC (rev 13757)
+++ gnucash/trunk/ChangeLog	2006-04-08 23:52:20 UTC (rev 13758)
@@ -1,3 +1,11 @@
+2006-04-08  David Hampton  <hampton at employees.org>
+
+	* src/gnome-utils/account-quickfill.c: Eliminate some unnecessary
+	work by comparing the account name in the quickfill with the
+	actual account name, and only rebuilding the quickfill if they
+	differ.  This improves GnuCash's response somewhat, but still
+	needs more improvement.
+
 2006-04-07  David Hampton  <hampton at employees.org>
 
 	* src/gnome-utils/gnc-main-window.c: Include the svn revision

Modified: gnucash/trunk/src/gnome-utils/account-quickfill.c
===================================================================
--- gnucash/trunk/src/gnome-utils/account-quickfill.c	2006-04-08 22:50:08 UTC (rev 13757)
+++ gnucash/trunk/src/gnome-utils/account-quickfill.c	2006-04-08 23:52:20 UTC (rev 13758)
@@ -277,6 +277,25 @@
     case QOF_EVENT_MODIFY:
       DEBUG("modify %s", name);
 
+      /* Did the account name change? */
+      if (data.found) {
+	gchar *old_name;
+	gint result;
+	if (gtk_tree_model_get_iter(GTK_TREE_MODEL(qfb->list_store),
+				    &iter, data.found)) {
+	  gtk_tree_model_get(GTK_TREE_MODEL(qfb->list_store), &iter,
+			     ACCOUNT_NAME, &old_name,
+			     -1);
+	  result = g_utf8_collate(name, old_name);
+	  g_free(old_name);
+	  if (result == 0) {
+	    /* The account name is unchanged. This routine doesn't
+	     * care what else might have changed, so bail now. */
+	    break;
+	  }
+	}
+      }
+
       /* Update qf */
       gnc_quickfill_purge(qfb->qf);
       xaccGroupForEachAccount (qfb->group, load_shared_qf_cb, qfb, TRUE);



More information about the gnucash-changes mailing list