[Gnucash-changes] r13163 - gnucash/trunk - A couple of performance enhancements.

David Hampton hampton at cvs.gnucash.org
Wed Feb 8 23:37:17 EST 2006


Author: hampton
Date: 2006-02-08 23:37:17 -0500 (Wed, 08 Feb 2006)
New Revision: 13163
Trac: http://svn.gnucash.org/trac/changeset/13163

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/engine/gnc-pricedb.c
   gnucash/trunk/src/gnome/dialog-price-edit-db.c
Log:
A couple of performance enhancements.

Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-02-09 04:35:34 UTC (rev 13162)
+++ gnucash/trunk/ChangeLog	2006-02-09 04:37:17 UTC (rev 13163)
@@ -1,3 +1,17 @@
+2006-02-08  David Hampton  <hampton at 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 at wilddev.net>
 
 	* NEWS: Added some text about the release.

Modified: gnucash/trunk/src/engine/gnc-pricedb.c
===================================================================
--- gnucash/trunk/src/engine/gnc-pricedb.c	2006-02-09 04:35:34 UTC (rev 13162)
+++ gnucash/trunk/src/engine/gnc-pricedb.c	2006-02-09 04:37:17 UTC (rev 13163)
@@ -87,10 +87,7 @@
 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_destroy (p);
   }
-  LEAVE (" ");
 }
 
 /* ==================================================================== */

Modified: gnucash/trunk/src/gnome/dialog-price-edit-db.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-price-edit-db.c	2006-02-09 04:35:34 UTC (rev 13162)
+++ gnucash/trunk/src/gnome/dialog-price-edit-db.c	2006-02-09 04:37:17 UTC (rev 13163)
@@ -308,8 +308,8 @@
 {
   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 @@
   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 @@
 				 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



More information about the gnucash-changes mailing list