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.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13758 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
David Hampton 2006-04-08 23:52:20 +00:00
parent ed58ab94a7
commit 454aabb1bd
2 changed files with 27 additions and 0 deletions

View File

@ -1,3 +1,11 @@
2006-04-08 David Hampton <hampton@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@employees.org>
* src/gnome-utils/gnc-main-window.c: Include the svn revision

View File

@ -277,6 +277,25 @@ listen_for_account_events (QofEntity *entity, QofEventId event_type,
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);