[Gnucash-changes] r13765 - gnucash/trunk - Get gnucash to build properly with the new QOF changes (0.6.4+)

Derek Atkins warlord at cvs.gnucash.org
Mon Apr 10 18:20:13 EDT 2006


Author: warlord
Date: 2006-04-10 18:20:12 -0400 (Mon, 10 Apr 2006)
New Revision: 13765
Trac: http://svn.gnucash.org/trac/changeset/13765

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/backend/file/sixtp-utils.c
   gnucash/trunk/src/engine/Account.c
   gnucash/trunk/src/engine/Transaction.c
   gnucash/trunk/src/engine/gnc-commodity.c
   gnucash/trunk/src/engine/gnc-engine.c
   gnucash/trunk/src/engine/gnc-pricedb.c
   gnucash/trunk/src/engine/kvp-scm.c
   gnucash/trunk/src/gnome-utils/QuickFill.c
Log:
Get gnucash to build properly with the new QOF changes (0.6.4+)

	* src/backend/file/sixtp-utils.c:
	  use QOF_SCANF_LLD to read 64-bit numbers.
	* src/gnome-utils/QuickFill.c:
	* src/engine/gnc-pricedb.c:
	* src/engine/Transaction.c:
	* src/engine/gnc-commodity.c:
	  convert gnc_string_cache* APIs to CACHE_* APIs.
	* src/engine/Account.c:
	  Properly convert usage of SAFE_STRCMP() to safe_strcmp()
	* src/engine/kvp-scm.c:
	  #include <qof.h> instead of <kvp_frame.h>
	* src/engine/gnc-engine.c:
	  Update the method used to shutdown QOF.



Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-04-10 22:13:46 UTC (rev 13764)
+++ gnucash/trunk/ChangeLog	2006-04-10 22:20:12 UTC (rev 13765)
@@ -18,6 +18,20 @@
 	  Keep the deprecated GNC_SCANF_LLD defined in terms of the new
 	  QOF_SCANF_LLD.
 
+	* src/backend/file/sixtp-utils.c:
+	  use QOF_SCANF_LLD to read 64-bit numbers.
+	* src/gnome-utils/QuickFill.c:
+	* src/engine/gnc-pricedb.c:
+	* src/engine/Transaction.c:
+	* src/engine/gnc-commodity.c:
+	  convert gnc_string_cache* APIs to CACHE_* APIs.
+	* src/engine/Account.c:
+	  Properly convert usage of SAFE_STRCMP() to safe_strcmp()
+	* src/engine/kvp-scm.c:
+	  #include <qof.h> instead of <kvp_frame.h>
+	* src/engine/gnc-engine.c:
+	  Update the method used to shutdown QOF.
+
 2006-04-08  David Hampton  <hampton at employees.org>
 
 	* src/gnome-utils/account-quickfill.c: Eliminate some unnecessary

Modified: gnucash/trunk/src/backend/file/sixtp-utils.c
===================================================================
--- gnucash/trunk/src/backend/file/sixtp-utils.c	2006-04-10 22:13:46 UTC (rev 13764)
+++ gnucash/trunk/src/backend/file/sixtp-utils.c	2006-04-10 22:20:12 UTC (rev 13765)
@@ -220,7 +220,7 @@
   g_return_val_if_fail(str, FALSE);
   
   /* must use "<" here because %n's effects aren't well defined */
-  if(sscanf(str, " " GNC_SCANF_LLD "%n", &v_in, &num_read) < 1) {
+  if(sscanf(str, " " QOF_SCANF_LLD "%n", &v_in, &num_read) < 1) {
     return(FALSE);
   }
 

Modified: gnucash/trunk/src/engine/Account.c
===================================================================
--- gnucash/trunk/src/engine/Account.c	2006-04-10 22:13:46 UTC (rev 13764)
+++ gnucash/trunk/src/engine/Account.c	2006-04-10 22:20:12 UTC (rev 13765)
@@ -999,7 +999,9 @@
   }
 
   /* Otherwise do a string sort */
-  SAFE_STRCMP (da, db);
+  result = safe_strcmp (da, db);
+  if (result)
+    return result;
 
   /* if acccount-type-order array not initialized, initialize it */
   /* this will happen at most once during program invocation */

Modified: gnucash/trunk/src/engine/Transaction.c
===================================================================
--- gnucash/trunk/src/engine/Transaction.c	2006-04-10 22:13:46 UTC (rev 13764)
+++ gnucash/trunk/src/engine/Transaction.c	2006-04-10 22:20:12 UTC (rev 13765)
@@ -242,8 +242,8 @@
 {
   ENTER ("trans=%p", trans);
   /* Fill in some sane defaults */
-  trans->num         = gnc_string_cache_insert("");
-  trans->description = gnc_string_cache_insert("");
+  trans->num         = CACHE_INSERT("");
+  trans->description = CACHE_INSERT("");
 
   trans->common_currency = NULL;
   trans->splits = NULL;
@@ -358,8 +358,8 @@
 
   trans = g_new0 (Transaction, 1);
 
-  trans->num         = gnc_string_cache_insert (t->num);
-  trans->description = gnc_string_cache_insert (t->description);
+  trans->num         = CACHE_INSERT (t->num);
+  trans->description = CACHE_INSERT (t->description);
 
   trans->splits = g_list_copy (t->splits);
   for (node = trans->splits; node; node = node->next)
@@ -405,8 +405,8 @@
 
   trans->date_entered    = t->date_entered;
   trans->date_posted     = t->date_posted;
-  trans->num             = gnc_string_cache_insert (t->num);
-  trans->description     = gnc_string_cache_insert (t->description);
+  trans->num             = CACHE_INSERT (t->num);
+  trans->description     = CACHE_INSERT (t->description);
   trans->common_currency = t->common_currency;
   trans->version         = t->version;
   trans->version_check   = t->version_check;
@@ -458,8 +458,8 @@
   trans->splits = NULL;
 
   /* free up transaction strings */
-  gnc_string_cache_remove(trans->num);
-  gnc_string_cache_remove(trans->description);
+  CACHE_REMOVE(trans->num);
+  CACHE_REMOVE(trans->description);
 
   /* Just in case someone looks up freed memory ... */
   trans->num         = (char *) 1;

Modified: gnucash/trunk/src/engine/gnc-commodity.c
===================================================================
--- gnucash/trunk/src/engine/gnc-commodity.c	2006-04-10 22:13:46 UTC (rev 13764)
+++ gnucash/trunk/src/engine/gnc-commodity.c	2006-04-10 22:20:12 UTC (rev 13765)
@@ -1239,7 +1239,7 @@
   PINFO ("insert %p %s into nsp=%p %s", comm->mnemonic, comm->mnemonic,
          nsp->cm_table, nsp->name);
   g_hash_table_insert(nsp->cm_table, 
-                      gnc_string_cache_insert(comm->mnemonic),
+                      CACHE_INSERT(comm->mnemonic),
                       (gpointer)comm);
   nsp->cm_list = g_list_append(nsp->cm_list, comm);
 
@@ -1482,7 +1482,7 @@
   {
     ns = g_new0(gnc_commodity_namespace, 1);
     ns->cm_table = g_hash_table_new(g_str_hash, g_str_equal);
-    ns->name = gnc_string_cache_insert((gpointer)namespace);
+    ns->name = CACHE_INSERT((gpointer)namespace);
     ns->iso4217 = gnc_commodity_namespace_is_iso(namespace);
     qof_instance_init (&ns->inst, GNC_ID_COMMODITY_NAMESPACE, book);
     qof_event_gen (&ns->inst.entity, QOF_EVENT_CREATE, NULL);
@@ -1539,7 +1539,7 @@
 {
   gnc_commodity * c = value;
   gnc_commodity_destroy(c);
-  gnc_string_cache_remove(key);  /* key is commodity mnemonic */
+  CACHE_REMOVE(key);  /* key is commodity mnemonic */
   return TRUE;
 }
 
@@ -1564,7 +1564,7 @@
 
   g_hash_table_foreach_remove(ns->cm_table, ns_helper, NULL);
   g_hash_table_destroy(ns->cm_table);
-  gnc_string_cache_remove(ns->name);
+  CACHE_REMOVE(ns->name);
 
   qof_event_gen (&ns->inst.entity, QOF_EVENT_DESTROY, NULL);
   qof_instance_release(&ns->inst);

Modified: gnucash/trunk/src/engine/gnc-engine.c
===================================================================
--- gnucash/trunk/src/engine/gnc-engine.c	2006-04-10 22:13:46 UTC (rev 13764)
+++ gnucash/trunk/src/engine/gnc-engine.c	2006-04-10 22:20:12 UTC (rev 13765)
@@ -119,11 +119,8 @@
 void
 gnc_engine_shutdown (void)
 {
-  qof_query_shutdown ();
-  qof_object_shutdown ();
-  guid_shutdown();
-  gnc_engine_string_cache_destroy ();
   qof_log_shutdown();
+  qof_close();
   engine_is_initialized = 0;
 }
 

Modified: gnucash/trunk/src/engine/gnc-pricedb.c
===================================================================
--- gnucash/trunk/src/engine/gnc-pricedb.c	2006-04-10 22:13:46 UTC (rev 13764)
+++ gnucash/trunk/src/engine/gnc-pricedb.c	2006-04-10 22:20:12 UTC (rev 13765)
@@ -67,8 +67,8 @@
   ENTER(" ");
   qof_event_gen (&p->inst.entity, QOF_EVENT_DESTROY, NULL);
 
-  if(p->type) gnc_string_cache_remove(p->type);
-  if(p->source) gnc_string_cache_remove(p->source);
+  if(p->type) CACHE_REMOVE(p->type);
+  if(p->source) CACHE_REMOVE(p->source);
 
   qof_instance_release (&p->inst);
   memset(p, 0, sizeof(GNCPrice));
@@ -260,8 +260,8 @@
     char *tmp;
 
     gnc_price_begin_edit (p);
-    tmp = gnc_string_cache_insert((gpointer) s);
-    if(p->source) gnc_string_cache_remove(p->source);
+    tmp = CACHE_INSERT((gpointer) s);
+    if(p->source) CACHE_REMOVE(p->source);
     p->source = tmp;
     gnc_price_set_dirty(p);
     gnc_price_commit_edit (p);
@@ -277,8 +277,8 @@
     gchar *tmp;
 
     gnc_price_begin_edit (p);
-    tmp = gnc_string_cache_insert((gpointer) type);
-    if(p->type) gnc_string_cache_remove(p->type);
+    tmp = CACHE_INSERT((gpointer) type);
+    if(p->type) CACHE_REMOVE(p->type);
     p->type = tmp;
     gnc_price_set_dirty(p);
     gnc_price_commit_edit (p);

Modified: gnucash/trunk/src/engine/kvp-scm.c
===================================================================
--- gnucash/trunk/src/engine/kvp-scm.c	2006-04-10 22:13:46 UTC (rev 13764)
+++ gnucash/trunk/src/engine/kvp-scm.c	2006-04-10 22:20:12 UTC (rev 13765)
@@ -1,6 +1,6 @@
 #include "config.h"
 
-#include <kvp_frame.h>
+#include <qof.h>
 #include <g-wrap-wct.h>
 #include <libguile.h>
 #include <engine-helpers.h>

Modified: gnucash/trunk/src/gnome-utils/QuickFill.c
===================================================================
--- gnucash/trunk/src/gnome-utils/QuickFill.c	2006-04-10 22:13:46 UTC (rev 13764)
+++ gnucash/trunk/src/gnome-utils/QuickFill.c	2006-04-10 22:20:12 UTC (rev 13765)
@@ -111,7 +111,7 @@
   qf->matches = NULL;
 
   if (qf->text)
-    gnc_string_cache_remove(qf->text);
+    CACHE_REMOVE(qf->text);
   qf->text = NULL;
   qf->len = 0;
 
@@ -127,7 +127,7 @@
   g_hash_table_foreach_remove (qf->matches, destroy_helper, NULL);
 
   if (qf->text)
-    gnc_string_cache_remove (qf->text);
+    CACHE_REMOVE (qf->text);
   qf->text = NULL;
   qf->len = 0;
 }
@@ -302,7 +302,7 @@
       /* If there's no string there already, just put the new one in. */
       if (old_text == NULL)
       {
-        match_qf->text = gnc_string_cache_insert((gpointer) text);
+        match_qf->text = CACHE_INSERT((gpointer) text);
         match_qf->len = len;
         break;
       }
@@ -312,8 +312,8 @@
           (strncmp(text, old_text, strlen(old_text)) == 0))
         break;
 
-      gnc_string_cache_remove(old_text);
-      match_qf->text = gnc_string_cache_insert((gpointer) text);
+      CACHE_REMOVE(old_text);
+      match_qf->text = CACHE_INSERT((gpointer) text);
       match_qf->len = len;
       break;
   }



More information about the gnucash-changes mailing list