A couple of performance enhancements.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13163 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
David Hampton
2006-02-09 04:37:17 +00:00
parent 6a4ed52700
commit dd05a94ffb
3 changed files with 18 additions and 21 deletions
+14
View File
@@ -1,3 +1,17 @@
2006-02-08 David Hampton <hampton@employees.org>
* src/gnome/dialog-price-edit-db.c:
* src/engine/gnc-pricedb.c: A couple of performance enhancements.
* src/gnome/gnc-plugin-basic-commands.c: Set the busy cursor while
the dialogs are being generated.
* src/gnome/glade/commodities.glade:
* src/gnome/glade/price.glade: Set the window type hint to normal.
* src/gnome-utils/glade/commodity.glade: Fix a duplicate
accelerator key.
2006-02-08 Chris Lyttle <chris@wilddev.net>
* NEWS: Added some text about the release.
-4
View File
@@ -87,10 +87,7 @@ void
gnc_price_unref(GNCPrice *p)
{
if(!p) return;
ENTER("pr=%p refcount=%d", p, p->refcount);
if(p->refcount == 0) {
PERR("refcount == 0 !!!!");
LEAVE (" ");
return;
}
@@ -102,7 +99,6 @@ gnc_price_unref(GNCPrice *p)
}
gnc_price_destroy (p);
}
LEAVE (" ");
}
/* ==================================================================== */
+4 -17
View File
@@ -308,8 +308,8 @@ gnc_price_dialog_filter_ns_func (gnc_commodity_namespace *namespace,
{
PricesDialog *pdb_dialog = data;
const gchar *name;
GList *cm_list, *price_list, *item;
gboolean result;
static GList *cm_list;
GList *item;
/* Never show the template list */
name = gnc_commodity_namespace_get_name (namespace);
@@ -321,12 +321,7 @@ gnc_price_dialog_filter_ns_func (gnc_commodity_namespace *namespace,
for (item = cm_list; item; item = g_list_next(item)) {
/* For each commodity, see if there are prices */
price_list = gnc_pricedb_get_prices(pdb_dialog->price_db, item->data, NULL);
result = (price_list != NULL);
gnc_price_list_destroy(price_list);
if (result) {
// printf("Namespace %s visible because %s has prices\n",
// name, gnc_commodity_get_mnemonic(item->data));
if (gnc_pricedb_has_prices(pdb_dialog->price_db, item->data, NULL)) {
return TRUE;
}
}
@@ -340,17 +335,9 @@ gnc_price_dialog_filter_cm_func (gnc_commodity *commodity,
gpointer data)
{
PricesDialog *pdb_dialog = data;
GList *list;
gboolean result;
/* Show any commodity that has prices */
list = gnc_pricedb_get_prices(pdb_dialog->price_db, commodity, NULL);
result = (list != NULL);
gnc_price_list_destroy(list);
// printf("Commodity %s%s visible\n",
// gnc_commodity_get_mnemonic(commodity),
// result ? "" : " not");
return result;
return gnc_pricedb_has_prices(pdb_dialog->price_db, commodity, NULL);
}
static void