From 454aabb1bdb84119c8498f1c1b71796f8d3bbfb6 Mon Sep 17 00:00:00 2001 From: David Hampton Date: Sat, 8 Apr 2006 23:52:20 +0000 Subject: [PATCH] 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 --- ChangeLog | 8 ++++++++ src/gnome-utils/account-quickfill.c | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2ad199673a..e03806de03 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-04-08 David Hampton + + * 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 * src/gnome-utils/gnc-main-window.c: Include the svn revision diff --git a/src/gnome-utils/account-quickfill.c b/src/gnome-utils/account-quickfill.c index 3be212d351..f0f418e382 100644 --- a/src/gnome-utils/account-quickfill.c +++ b/src/gnome-utils/account-quickfill.c @@ -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);