[Gnucash-changes] r13763 - gnucash/trunk - Revert r13749. Wedon't need to explicitly #include glib.h

Derek Atkins warlord at cvs.gnucash.org
Mon Apr 10 17:49:45 EDT 2006


Author: warlord
Date: 2006-04-10 17:49:44 -0400 (Mon, 10 Apr 2006)
New Revision: 13763
Trac: http://svn.gnucash.org/trac/changeset/13763

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/backend/file/sixtp-utils.c
   gnucash/trunk/src/backend/file/test/test-load-backend.c
   gnucash/trunk/src/business/business-core/gncBusGuile.c
   gnucash/trunk/src/business/business-core/gw-business-core-spec.scm
   gnucash/trunk/src/business/dialog-tax-table/gw-dialog-tax-table-spec.scm
   gnucash/trunk/src/engine/Account.c
   gnucash/trunk/src/engine/Period.c
   gnucash/trunk/src/engine/SchedXaction.c
   gnucash/trunk/src/engine/Transaction.c
   gnucash/trunk/src/engine/engine-helpers.c
   gnucash/trunk/src/engine/gnc-associate-account.c
   gnucash/trunk/src/engine/gnc-commodity.c
   gnucash/trunk/src/engine/gnc-engine.c
   gnucash/trunk/src/engine/gnc-lot.c
   gnucash/trunk/src/engine/gnc-pricedb.c
   gnucash/trunk/src/engine/gnc-session.c
   gnucash/trunk/src/engine/gw-kvp-spec.scm
   gnucash/trunk/src/engine/kvp-scm.c
   gnucash/trunk/src/engine/test/test-load-engine.c
   gnucash/trunk/src/gnome-utils/QuickFill.c
   gnucash/trunk/src/register/ledger-core/gnc-ledger-display.c
Log:
Revert r13749.  Wedon't need to explicitly #include glib.h
because qof.h includes it for us.  Also, this changeset contains
lots of other stuff that has nothing to do with glib.h.  Note
that this revision wont build, but I'll fix that shortly.



Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-04-10 21:14:34 UTC (rev 13762)
+++ gnucash/trunk/ChangeLog	2006-04-10 21:49:44 UTC (rev 13763)
@@ -6,6 +6,12 @@
 	  because qof.h includes it for us.  Besides, it doesn't fix
 	  the whole problem.
 
+	* lots of files:
+	  Revert r13749.  Wedon't need to explicitly #include glib.h
+	  because qof.h includes it for us.  Also, this changeset contains
+	  lots of other stuff that has nothing to do with glib.h.  Note
+	  that this revision wont build, but I'll fix that shortly.
+
 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 21:14:34 UTC (rev 13762)
+++ gnucash/trunk/src/backend/file/sixtp-utils.c	2006-04-10 21:49:44 UTC (rev 13763)
@@ -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, " %" G_GINT64_FORMAT "%n", &v_in, &num_read) < 1) {
+  if(sscanf(str, " " GNC_SCANF_LLD "%n", &v_in, &num_read) < 1) {
     return(FALSE);
   }
 

Modified: gnucash/trunk/src/backend/file/test/test-load-backend.c
===================================================================
--- gnucash/trunk/src/backend/file/test/test-load-backend.c	2006-04-10 21:14:34 UTC (rev 13762)
+++ gnucash/trunk/src/backend/file/test/test-load-backend.c	2006-04-10 21:49:44 UTC (rev 13763)
@@ -25,7 +25,6 @@
  *  02110-1301, USA.
  */
  
-#include <glib.h>
 #include "qof.h"
 #include "cashobjects.h"
 #include "test-stuff.h"

Modified: gnucash/trunk/src/business/business-core/gncBusGuile.c
===================================================================
--- gnucash/trunk/src/business/business-core/gncBusGuile.c	2006-04-10 21:14:34 UTC (rev 13762)
+++ gnucash/trunk/src/business/business-core/gncBusGuile.c	2006-04-10 21:49:44 UTC (rev 13763)
@@ -22,7 +22,7 @@
  */
 
 #include "config.h"
-#include <glib.h>
+
 #include "gncBusGuile.h"
 #include "engine-helpers.h"
 #include <g-wrap-wct.h>

Modified: gnucash/trunk/src/business/business-core/gw-business-core-spec.scm
===================================================================
--- gnucash/trunk/src/business/business-core/gw-business-core-spec.scm	2006-04-10 21:14:34 UTC (rev 13762)
+++ gnucash/trunk/src/business/business-core/gw-business-core-spec.scm	2006-04-10 21:49:44 UTC (rev 13763)
@@ -34,7 +34,6 @@
    ws
    (lambda (wrapset client-wrapset)
      (list
-      "#include <glib.h>\n"
       "#include <gncAddress.h>\n"
       "#include <gncBillTerm.h>\n"
       "#include <gncCustomer.h>\n"

Modified: gnucash/trunk/src/business/dialog-tax-table/gw-dialog-tax-table-spec.scm
===================================================================
--- gnucash/trunk/src/business/dialog-tax-table/gw-dialog-tax-table-spec.scm	2006-04-10 21:14:34 UTC (rev 13762)
+++ gnucash/trunk/src/business/dialog-tax-table/gw-dialog-tax-table-spec.scm	2006-04-10 21:49:44 UTC (rev 13763)
@@ -33,7 +33,6 @@
    (lambda (wrapset client-wrapset)
      (list
       "#include <config.h>\n"
-      "#include <glib.h>\n"
       "#include <dialog-tax-table.h>\n"
       )))
 

Modified: gnucash/trunk/src/engine/Account.c
===================================================================
--- gnucash/trunk/src/engine/Account.c	2006-04-10 21:14:34 UTC (rev 13762)
+++ gnucash/trunk/src/engine/Account.c	2006-04-10 21:49:44 UTC (rev 13763)
@@ -126,9 +126,9 @@
 
   acc->type = NO_TYPE;
 
-  acc->accountName = QOF_CACHE_NEW();
-  acc->accountCode = QOF_CACHE_NEW();
-  acc->description = QOF_CACHE_NEW();
+  acc->accountName = CACHE_INSERT("");
+  acc->accountCode = CACHE_INSERT("");
+  acc->description = CACHE_INSERT("");
 
   acc->idata = 0;
 
@@ -999,8 +999,7 @@
   }
 
   /* Otherwise do a string sort */
-  safe_strcmp (da, db);
-/*  SAFE_STRCMP (da, db);*/
+  SAFE_STRCMP (da, db);
 
   /* if acccount-type-order array not initialized, initialize it */
   /* this will happen at most once during program invocation */

Modified: gnucash/trunk/src/engine/Period.c
===================================================================
--- gnucash/trunk/src/engine/Period.c	2006-04-10 21:14:34 UTC (rev 13762)
+++ gnucash/trunk/src/engine/Period.c	2006-04-10 21:49:44 UTC (rev 13763)
@@ -33,7 +33,6 @@
  * Copyright (c) 2001-2003 Linas Vepstas <linas at linas.org>
  */
 
-#include <glib.h>
 #include "AccountP.h"
 #include "qof.h"
 #include "gnc-lot.h"

Modified: gnucash/trunk/src/engine/SchedXaction.c
===================================================================
--- gnucash/trunk/src/engine/SchedXaction.c	2006-04-10 21:14:34 UTC (rev 13762)
+++ gnucash/trunk/src/engine/SchedXaction.c	2006-04-10 21:49:44 UTC (rev 13763)
@@ -31,6 +31,7 @@
 
 #include "FreqSpec.h"
 #include "Account.h"
+#include "gnc-book.h"
 #include "Group.h"
 #include "GroupP.h"
 #include "SX-book.h"

Modified: gnucash/trunk/src/engine/Transaction.c
===================================================================
--- gnucash/trunk/src/engine/Transaction.c	2006-04-10 21:14:34 UTC (rev 13762)
+++ gnucash/trunk/src/engine/Transaction.c	2006-04-10 21:49:44 UTC (rev 13763)
@@ -242,8 +242,8 @@
 {
   ENTER ("trans=%p", trans);
   /* Fill in some sane defaults */
-  trans->num         = QOF_CACHE_NEW();
-  trans->description = QOF_CACHE_NEW();
+  trans->num         = gnc_string_cache_insert("");
+  trans->description = gnc_string_cache_insert("");
 
   trans->common_currency = NULL;
   trans->splits = NULL;
@@ -358,8 +358,8 @@
 
   trans = g_new0 (Transaction, 1);
 
-  trans->num         = qof_util_string_cache_insert (t->num);
-  trans->description = qof_util_string_cache_insert (t->description);
+  trans->num         = gnc_string_cache_insert (t->num);
+  trans->description = gnc_string_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             = qof_util_string_cache_insert (t->num);
-  trans->description     = qof_util_string_cache_insert (t->description);
+  trans->num             = gnc_string_cache_insert (t->num);
+  trans->description     = gnc_string_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 */
-  qof_util_string_cache_remove(trans->num);
-  qof_util_string_cache_remove(trans->description);
+  gnc_string_cache_remove(trans->num);
+  gnc_string_cache_remove(trans->description);
 
   /* Just in case someone looks up freed memory ... */
   trans->num         = (char *) 1;

Modified: gnucash/trunk/src/engine/engine-helpers.c
===================================================================
--- gnucash/trunk/src/engine/engine-helpers.c	2006-04-10 21:14:34 UTC (rev 13762)
+++ gnucash/trunk/src/engine/engine-helpers.c	2006-04-10 21:49:44 UTC (rev 13763)
@@ -27,7 +27,7 @@
 #include <g-wrap-wct.h>
 #include <libguile.h>
 #include <string.h>
-#include <glib.h>
+
 #include "Account.h"
 #include "Group.h"
 #include "engine-helpers.h"

Modified: gnucash/trunk/src/engine/gnc-associate-account.c
===================================================================
--- gnucash/trunk/src/engine/gnc-associate-account.c	2006-04-10 21:14:34 UTC (rev 13762)
+++ gnucash/trunk/src/engine/gnc-associate-account.c	2006-04-10 21:49:44 UTC (rev 13763)
@@ -27,7 +27,7 @@
 \********************************************************************/
 
 #include "config.h"
-#include <glib.h>
+
 #include "AccountP.h"
 #include "gnc-associate-account.h"
 #include "gnc-engine.h"

Modified: gnucash/trunk/src/engine/gnc-commodity.c
===================================================================
--- gnucash/trunk/src/engine/gnc-commodity.c	2006-04-10 21:14:34 UTC (rev 13762)
+++ gnucash/trunk/src/engine/gnc-commodity.c	2006-04-10 21:49:44 UTC (rev 13763)
@@ -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, 
-                      qof_util_string_cache_insert(comm->mnemonic),
+                      gnc_string_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 = qof_util_string_cache_insert((gpointer)namespace);
+    ns->name = gnc_string_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);
-  qof_util_string_cache_remove(key);  /* key is commodity mnemonic */
+  gnc_string_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);
-  qof_util_string_cache_remove(ns->name);
+  gnc_string_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 21:14:34 UTC (rev 13762)
+++ gnucash/trunk/src/engine/gnc-engine.c	2006-04-10 21:49:44 UTC (rev 13763)
@@ -119,8 +119,11 @@
 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-lot.c
===================================================================
--- gnucash/trunk/src/engine/gnc-lot.c	2006-04-10 21:14:34 UTC (rev 13762)
+++ gnucash/trunk/src/engine/gnc-lot.c	2006-04-10 21:49:44 UTC (rev 13763)
@@ -39,7 +39,6 @@
  * Copyright (c) 2002,2003 Linas Vepstas <linas at linas.org>
  */
 
-#include <glib.h>
 #include "Account.h"
 #include "gnc-lot.h"
 #include "gnc-lot-p.h"

Modified: gnucash/trunk/src/engine/gnc-pricedb.c
===================================================================
--- gnucash/trunk/src/engine/gnc-pricedb.c	2006-04-10 21:14:34 UTC (rev 13762)
+++ gnucash/trunk/src/engine/gnc-pricedb.c	2006-04-10 21:49:44 UTC (rev 13763)
@@ -67,8 +67,8 @@
   ENTER(" ");
   qof_event_gen (&p->inst.entity, QOF_EVENT_DESTROY, NULL);
 
-  if(p->type) qof_util_string_cache_remove(p->type);
-  if(p->source) qof_util_string_cache_remove(p->source);
+  if(p->type) gnc_string_cache_remove(p->type);
+  if(p->source) gnc_string_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 = qof_util_string_cache_insert((gpointer) s);
-    if(p->source) qof_util_string_cache_remove(p->source);
+    tmp = gnc_string_cache_insert((gpointer) s);
+    if(p->source) gnc_string_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 = qof_util_string_cache_insert((gpointer) type);
-    if(p->type) qof_util_string_cache_remove(p->type);
+    tmp = gnc_string_cache_insert((gpointer) type);
+    if(p->type) gnc_string_cache_remove(p->type);
     p->type = tmp;
     gnc_price_set_dirty(p);
     gnc_price_commit_edit (p);

Modified: gnucash/trunk/src/engine/gnc-session.c
===================================================================
--- gnucash/trunk/src/engine/gnc-session.c	2006-04-10 21:14:34 UTC (rev 13762)
+++ gnucash/trunk/src/engine/gnc-session.c	2006-04-10 21:49:44 UTC (rev 13763)
@@ -22,7 +22,6 @@
  */
 
 #include "config.h"
-#include <glib.h>
 #include "qof.h"
 #include "gnc-session.h"
 #include "gnc-engine.h"

Modified: gnucash/trunk/src/engine/gw-kvp-spec.scm
===================================================================
--- gnucash/trunk/src/engine/gw-kvp-spec.scm	2006-04-10 21:14:34 UTC (rev 13762)
+++ gnucash/trunk/src/engine/gw-kvp-spec.scm	2006-04-10 21:49:44 UTC (rev 13763)
@@ -26,7 +26,6 @@
    ws
    (lambda (wrapset client-wrapset)
      (list
-      "#include <glib.h>\n"
       "#include <qof.h>\n"
       "#include <kvp-scm.h>\n"
       "#include <Transaction.h>\n")))

Modified: gnucash/trunk/src/engine/kvp-scm.c
===================================================================
--- gnucash/trunk/src/engine/kvp-scm.c	2006-04-10 21:14:34 UTC (rev 13762)
+++ gnucash/trunk/src/engine/kvp-scm.c	2006-04-10 21:49:44 UTC (rev 13763)
@@ -1,5 +1,5 @@
 #include "config.h"
-#include <glib.h>
+
 #include <kvp_frame.h>
 #include <g-wrap-wct.h>
 #include <libguile.h>

Modified: gnucash/trunk/src/engine/test/test-load-engine.c
===================================================================
--- gnucash/trunk/src/engine/test/test-load-engine.c	2006-04-10 21:14:34 UTC (rev 13762)
+++ gnucash/trunk/src/engine/test/test-load-engine.c	2006-04-10 21:49:44 UTC (rev 13763)
@@ -23,7 +23,6 @@
  
 #include <stdio.h>
 #include <stdlib.h>
-#include <glib.h>
 #include "qof.h"
 #include "cashobjects.h"
 #include "test-stuff.h"

Modified: gnucash/trunk/src/gnome-utils/QuickFill.c
===================================================================
--- gnucash/trunk/src/gnome-utils/QuickFill.c	2006-04-10 21:14:34 UTC (rev 13762)
+++ gnucash/trunk/src/gnome-utils/QuickFill.c	2006-04-10 21:49:44 UTC (rev 13763)
@@ -111,7 +111,7 @@
   qf->matches = NULL;
 
   if (qf->text)
-    qof_util_string_cache_remove(qf->text);
+    gnc_string_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)
-    qof_util_string_cache_remove (qf->text);
+    gnc_string_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 = qof_util_string_cache_insert((gpointer) text);
+        match_qf->text = gnc_string_cache_insert((gpointer) text);
         match_qf->len = len;
         break;
       }
@@ -312,8 +312,8 @@
           (strncmp(text, old_text, strlen(old_text)) == 0))
         break;
 
-      qof_util_string_cache_remove(old_text);
-      match_qf->text = qof_util_string_cache_insert((gpointer) text);
+      gnc_string_cache_remove(old_text);
+      match_qf->text = gnc_string_cache_insert((gpointer) text);
       match_qf->len = len;
       break;
   }

Modified: gnucash/trunk/src/register/ledger-core/gnc-ledger-display.c
===================================================================
--- gnucash/trunk/src/register/ledger-core/gnc-ledger-display.c	2006-04-10 21:14:34 UTC (rev 13762)
+++ gnucash/trunk/src/register/ledger-core/gnc-ledger-display.c	2006-04-10 21:49:44 UTC (rev 13763)
@@ -24,7 +24,7 @@
 #include "config.h"
 
 #include <time.h>
-#include <glib.h>
+
 #include "Account.h"
 #include "Group.h"
 #include "Query.h"



More information about the gnucash-changes mailing list