r16768 - gnucash/branches/gda-dev2 - Merge trunk through rev 16767

Phil Longstaff plongstaff at cvs.gnucash.org
Sun Dec 30 10:12:17 EST 2007


Author: plongstaff
Date: 2007-12-30 10:12:16 -0500 (Sun, 30 Dec 2007)
New Revision: 16768
Trac: http://svn.gnucash.org/trac/changeset/16768

Modified:
   gnucash/branches/gda-dev2/accounts/de_AT/acctchrt_brokerage.gnucash-xea
   gnucash/branches/gda-dev2/accounts/de_CH/acctchrt_brokerage.gnucash-xea
   gnucash/branches/gda-dev2/accounts/de_CH/acctchrt_common.gnucash-xea
   gnucash/branches/gda-dev2/accounts/de_DE/acctchrt_brokerage.gnucash-xea
   gnucash/branches/gda-dev2/accounts/de_DE/acctchrt_common.gnucash-xea
   gnucash/branches/gda-dev2/configure.in
   gnucash/branches/gda-dev2/lib/libqof/qof/gnc-date.c
   gnucash/branches/gda-dev2/lib/libqof/qof/gnc-date.h
   gnucash/branches/gda-dev2/lib/libqof/qof/kvp_frame.c
   gnucash/branches/gda-dev2/lib/libqof/qof/kvp_frame.h
   gnucash/branches/gda-dev2/lib/libqof/qof/qofbackend.c
   gnucash/branches/gda-dev2/lib/libqof/qof/qofbackend.h
   gnucash/branches/gda-dev2/lib/libqof/qof/qofbook.c
   gnucash/branches/gda-dev2/lib/libqof/qof/qofbook.h
   gnucash/branches/gda-dev2/lib/libqof/qof/qofbookmerge.c
   gnucash/branches/gda-dev2/lib/libqof/qof/qofid.c
   gnucash/branches/gda-dev2/lib/libqof/qof/qofid.h
   gnucash/branches/gda-dev2/lib/libqof/qof/qofinstance.c
   gnucash/branches/gda-dev2/lib/libqof/qof/qoflog.c
   gnucash/branches/gda-dev2/lib/libqof/qof/qoflog.h
   gnucash/branches/gda-dev2/lib/libqof/qof/qofquery-p.h
   gnucash/branches/gda-dev2/lib/libqof/qof/qofquery.c
   gnucash/branches/gda-dev2/lib/libqof/qof/qofquery.h
   gnucash/branches/gda-dev2/lib/libqof/qof/qofquerycore-p.h
   gnucash/branches/gda-dev2/lib/libqof/qof/qofquerycore.c
   gnucash/branches/gda-dev2/lib/libqof/qof/qofquerycore.h
   gnucash/branches/gda-dev2/lib/libqof/qof/qofsession-p.h
   gnucash/branches/gda-dev2/lib/libqof/qof/qofsession.c
   gnucash/branches/gda-dev2/lib/libqof/qof/qofsession.h
   gnucash/branches/gda-dev2/po/POTFILES.skip
   gnucash/branches/gda-dev2/src/app-utils/gnc-sx-instance-model.c
   gnucash/branches/gda-dev2/src/engine/cap-gains.c
   gnucash/branches/gda-dev2/src/engine/cap-gains.h
   gnucash/branches/gda-dev2/src/engine/engine-helpers.c
   gnucash/branches/gda-dev2/src/engine/engine-helpers.h
   gnucash/branches/gda-dev2/src/engine/gnc-commodity.c
   gnucash/branches/gda-dev2/src/engine/gnc-commodity.h
   gnucash/branches/gda-dev2/src/engine/test/test-book-merge.c
   gnucash/branches/gda-dev2/src/gnome-utils/gnc-dense-cal.c
   gnucash/branches/gda-dev2/src/gnome-utils/gnc-tree-model-account.c
   gnucash/branches/gda-dev2/src/import-export/ofx/gnc-ofx-import.c
   gnucash/branches/gda-dev2/src/import-export/qif-import/qif-to-gnc.scm
   gnucash/branches/gda-dev2/src/report/standard-reports/advanced-portfolio.scm
   gnucash/branches/gda-dev2/src/report/standard-reports/cash-flow.scm
   gnucash/branches/gda-dev2/src/valgrind-gnucash.supp
Log:
Merge trunk through rev 16767



Modified: gnucash/branches/gda-dev2/accounts/de_AT/acctchrt_brokerage.gnucash-xea
===================================================================
--- gnucash/branches/gda-dev2/accounts/de_AT/acctchrt_brokerage.gnucash-xea	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/accounts/de_AT/acctchrt_brokerage.gnucash-xea	2007-12-30 15:12:16 UTC (rev 16768)
@@ -100,14 +100,14 @@
   <act:parent type="new">d6b0c9d2b6f67e852f627793cd4a8c45</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>Erträge</act:name>
+  <act:name>Erträge</act:name>
   <act:id type="new">724c2a1128e49b0b28304d372b19f5a1</act:id>
   <act:type>INCOME</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>USD</cmdty:id>
   </act:commodity>
-  <act:description>Erträge</act:description>
+  <act:description>Erträge</act:description>
   <act:slots>
     <slot>
       <slot:key>placeholder</slot:key>

Modified: gnucash/branches/gda-dev2/accounts/de_CH/acctchrt_brokerage.gnucash-xea
===================================================================
--- gnucash/branches/gda-dev2/accounts/de_CH/acctchrt_brokerage.gnucash-xea	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/accounts/de_CH/acctchrt_brokerage.gnucash-xea	2007-12-30 15:12:16 UTC (rev 16768)
@@ -82,14 +82,14 @@
   <act:parent type="new">d6b0c9d2b6f67e852f627793cd4a8c45</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>Erträge</act:name>
+  <act:name>Erträge</act:name>
   <act:id type="new">724c2a1128e49b0b28304d372b19f5a1</act:id>
   <act:type>INCOME</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>USD</cmdty:id>
   </act:commodity>
-  <act:description>Erträge</act:description>
+  <act:description>Erträge</act:description>
   <act:parent type="new">1972cce2e2364f95b2b0bc014502661d</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">

Modified: gnucash/branches/gda-dev2/accounts/de_CH/acctchrt_common.gnucash-xea
===================================================================
--- gnucash/branches/gda-dev2/accounts/de_CH/acctchrt_common.gnucash-xea	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/accounts/de_CH/acctchrt_common.gnucash-xea	2007-12-30 15:12:16 UTC (rev 16768)
@@ -7,7 +7,7 @@
       Grundlegende Kontenstruktur
     </gnc-act:short-description>
     <gnc-act:long-description>
-    Die meisten Anwender benötigen diese grundlegende Kontenstruktur. Sie finden hier die allgemein üblichen Konten wie Giro-, Sparkonto, Bargeld, Kreditkarte, Erträge und verschiedene Ausgaben.
+    Die meisten Anwender benötigen diese grundlegende Kontenstruktur. Sie finden hier die allgemein üblichen Konten wie Giro-, Sparkonto, Bargeld, Kreditkarte, Erträge und verschiedene Ausgaben.
   </gnc-act:long-description>
   <gnc-act:start-selected>1</gnc-act:start-selected>
 <gnc:account version="2.0.0">
@@ -105,14 +105,14 @@
   <act:parent type="new">265c29e7f9adb75346f96a4f7e79654e</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>Erträge</act:name>
+  <act:name>Erträge</act:name>
   <act:id type="new">724c2a1128e49b0b28304d372b19f5a1</act:id>
   <act:type>INCOME</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>USD</cmdty:id>
   </act:commodity>
-  <act:description>Erträge</act:description>
+  <act:description>Erträge</act:description>
   <act:parent type="new">1972cce2e2364f95b2b0bc014502661d</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
@@ -167,7 +167,7 @@
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>USD</cmdty:id>
   </act:commodity>
-  <act:description>Sonstige Erträge</act:description>
+  <act:description>Sonstige Erträge</act:description>
   <act:parent type="new">724c2a1128e49b0b28304d372b19f5a1</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">

Modified: gnucash/branches/gda-dev2/accounts/de_DE/acctchrt_brokerage.gnucash-xea
===================================================================
--- gnucash/branches/gda-dev2/accounts/de_DE/acctchrt_brokerage.gnucash-xea	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/accounts/de_DE/acctchrt_brokerage.gnucash-xea	2007-12-30 15:12:16 UTC (rev 16768)
@@ -100,14 +100,14 @@
   <act:parent type="new">d6b0c9d2b6f67e852f627793cd4a8c45</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>Erträge</act:name>
+  <act:name>Erträge</act:name>
   <act:id type="new">724c2a1128e49b0b28304d372b19f5a1</act:id>
   <act:type>INCOME</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>USD</cmdty:id>
   </act:commodity>
-  <act:description>Erträge</act:description>
+  <act:description>Erträge</act:description>
   <act:slots>
     <slot>
       <slot:key>placeholder</slot:key>

Modified: gnucash/branches/gda-dev2/accounts/de_DE/acctchrt_common.gnucash-xea
===================================================================
--- gnucash/branches/gda-dev2/accounts/de_DE/acctchrt_common.gnucash-xea	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/accounts/de_DE/acctchrt_common.gnucash-xea	2007-12-30 15:12:16 UTC (rev 16768)
@@ -7,7 +7,7 @@
       Grundlegende Kontenstruktur
     </gnc-act:short-description>
     <gnc-act:long-description>
-    Die meisten Anwender benötigen diese grundlegende Kontenstruktur. Sie finden hier die allgemein üblichen Konten wie Giro-, Sparkonto, Bargeld, Kreditkarte, Erträge und verschiedene Ausgaben. Wenn Sie aber einen SKR verwenden wollen, brauchen Sie sie nicht.
+    Die meisten Anwender benötigen diese grundlegende Kontenstruktur. Sie finden hier die allgemein üblichen Konten wie Giro-, Sparkonto, Bargeld, Kreditkarte, Erträge und verschiedene Ausgaben. Wenn Sie aber einen SKR verwenden wollen, brauchen Sie sie nicht.
   </gnc-act:long-description>    
   <gnc-act:start-selected>1</gnc-act:start-selected>
 <gnc:account version="2.0.0">
@@ -129,14 +129,14 @@
   <act:parent type="new">265c29e7f9adb75346f96a4f7e79654e</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>Erträge</act:name>
+  <act:name>Erträge</act:name>
   <act:id type="new">724c2a1128e49b0b28304d372b19f5a1</act:id>
   <act:type>INCOME</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
-  <act:description>Erträge</act:description>
+  <act:description>Erträge</act:description>
   <act:slots>
     <slot>
       <slot:key>placeholder</slot:key>
@@ -203,7 +203,7 @@
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
-  <act:description>Sonstige Erträge</act:description>
+  <act:description>Sonstige Erträge</act:description>
   <act:parent type="new">724c2a1128e49b0b28304d372b19f5a1</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">

Modified: gnucash/branches/gda-dev2/configure.in
===================================================================
--- gnucash/branches/gda-dev2/configure.in	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/configure.in	2007-12-30 15:12:16 UTC (rev 16768)
@@ -20,7 +20,7 @@
 
 # Autoconf initialization
 AC_PREREQ(2.59)
-AC_INIT([gnucash], [2.2.1], [gnucash-devel at gnucash.org])
+AC_INIT([gnucash], [2.2.99], [gnucash-devel at gnucash.org])
 AC_CONFIG_HEADERS(config.h)
 AC_CONFIG_SRCDIR(src/engine/Transaction.h)
 

Modified: gnucash/branches/gda-dev2/lib/libqof/qof/gnc-date.c
===================================================================
--- gnucash/branches/gda-dev2/lib/libqof/qof/gnc-date.c	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/lib/libqof/qof/gnc-date.c	2007-12-30 15:12:16 UTC (rev 16768)
@@ -279,7 +279,7 @@
 param  tm: the time value in question
 return the last day of the month, integer.
 */
-int date_get_last_mday(struct tm *tm)
+int date_get_last_mday(const struct tm *tm)
 {
   return gnc_date_my_last_mday (tm->tm_mon+1, tm->tm_year+1900);
 }
@@ -291,7 +291,7 @@
 param  tm: the time value in question
 return TRUE if tm_mday matches the last day of the month, else FALSE.
 */
-gboolean date_is_last_mday(struct tm *tm)
+gboolean date_is_last_mday(const struct tm *tm)
 {
   return(tm->tm_mday == date_get_last_mday(tm));
 }
@@ -472,7 +472,7 @@
 }
 
 size_t
-qof_print_gdate( char *buf, size_t len, GDate *gd )
+qof_print_gdate( char *buf, size_t len, const GDate *gd )
 {
   return qof_print_date_dmy_buff( buf, len,
              g_date_get_day(gd),
@@ -1292,7 +1292,7 @@
 \********************************************************************/
 
 long int
-gnc_timezone (struct tm *tm)
+gnc_timezone (const struct tm *tm)
 {
   g_return_val_if_fail (tm != NULL, 0);
 

Modified: gnucash/branches/gda-dev2/lib/libqof/qof/gnc-date.h
===================================================================
--- gnucash/branches/gda-dev2/lib/libqof/qof/gnc-date.h	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/lib/libqof/qof/gnc-date.h	2007-12-30 15:12:16 UTC (rev 16768)
@@ -267,7 +267,7 @@
  * daylight savings time! Timezone stuff under unix is not
  * standardized and is a big mess.
  */
-glong gnc_timezone (struct tm *tm);
+glong gnc_timezone (const struct tm *tm);
 // @}
 
 /* ------------------------------------------------------------------------ */
@@ -380,7 +380,7 @@
 size_t qof_print_date_buff (char * buff, size_t buflen, time_t secs);
 
 /** Convenience; calls through to qof_print_date_dmy_buff(). **/
-size_t qof_print_gdate( char *buf, size_t bufflen, GDate *gd );
+size_t qof_print_gdate( char *buf, size_t bufflen, const GDate *gd );
 
 /** Convenience; calls through to qof_print_date_dmy_buff(). 
  *  Return: string, which should be freed when no longer needed.
@@ -499,10 +499,10 @@
 time_t gnc_timet_get_day_end(time_t time_val);
 
 /** Get the numerical last date of the month. (28, 29, 30, 31) */
-int date_get_last_mday(struct tm *tm);
+int date_get_last_mday(const struct tm *tm);
 
 /** Is the mday field the last day of the specified month.*/
-gboolean date_is_last_mday(struct tm *tm);
+gboolean date_is_last_mday(const struct tm *tm);
 
 /** \deprecated Use date_get_last_mday() */
 int gnc_date_my_last_mday (int month, int year);

Modified: gnucash/branches/gda-dev2/lib/libqof/qof/kvp_frame.c
===================================================================
--- gnucash/branches/gda-dev2/lib/libqof/qof/kvp_frame.c	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/lib/libqof/qof/kvp_frame.c	2007-12-30 15:12:16 UTC (rev 16768)
@@ -129,7 +129,7 @@
 }
 
 gboolean
-kvp_frame_is_empty(KvpFrame * frame) 
+kvp_frame_is_empty(const KvpFrame * frame) 
 {
   if (!frame) return TRUE;
   if (!frame->hash) return TRUE;
@@ -921,7 +921,7 @@
 /* ============================================================ */
 
 KvpFrame *
-kvp_frame_get_frame_gslist (KvpFrame *frame, GSList *key_path) 
+kvp_frame_get_frame_gslist (KvpFrame *frame, const GSList *key_path) 
 {
   if (!frame) return frame;
 
@@ -1010,7 +1010,7 @@
 
 KvpValue *
 kvp_frame_get_slot_path_gslist (KvpFrame *frame,
-                                GSList *key_path) 
+                                const GSList *key_path) 
 {
   if (!frame || !key_path) return NULL;
 

Modified: gnucash/branches/gda-dev2/lib/libqof/qof/kvp_frame.h
===================================================================
--- gnucash/branches/gda-dev2/lib/libqof/qof/kvp_frame.h	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/lib/libqof/qof/kvp_frame.h	2007-12-30 15:12:16 UTC (rev 16768)
@@ -126,7 +126,7 @@
 KvpFrame   * kvp_frame_copy(const KvpFrame * frame);
 
 /** Return TRUE if the KvpFrame is empty */
-gboolean     kvp_frame_is_empty(KvpFrame * frame);
+gboolean     kvp_frame_is_empty(const KvpFrame * frame);
 
 /** @} */
 
@@ -395,7 +395,7 @@
  *  Note that this is *VERY DIFFERENT FROM* kvp_frame_get_frame()
  */
 KvpFrame    * kvp_frame_get_frame_gslist (KvpFrame *frame,
-                                           GSList *key_path);
+                                           const GSList *key_path);
 
 /** This routine returns the last frame of the path.
  *  If the frame path doesn't exist, it is created.  
@@ -502,7 +502,7 @@
  * path, or NULL if any portion of the path doesn't exist.
  */
 KvpValue   * kvp_frame_get_slot_path_gslist (KvpFrame *frame,
-                                              GSList *key_path);
+                                              const GSList *key_path);
 
 /**
  * Similar returns as strcmp.

Modified: gnucash/branches/gda-dev2/lib/libqof/qof/qofbackend.c
===================================================================
--- gnucash/branches/gda-dev2/lib/libqof/qof/qofbackend.c	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/lib/libqof/qof/qofbackend.c	2007-12-30 15:12:16 UTC (rev 16768)
@@ -153,7 +153,7 @@
 }
 
 gboolean
-qof_backend_begin_exists(QofBackend *be)
+qof_backend_begin_exists(const QofBackend *be)
 {
 	if(be->begin) { return TRUE; }
 	else { return FALSE; }
@@ -179,7 +179,7 @@
 	be->config_count = 0;
 }
 
-void qof_backend_prepare_option(QofBackend *be, QofBackendOption *option)
+void qof_backend_prepare_option(QofBackend *be, const QofBackendOption *option)
 {
 	KvpValue *value;
 	gchar *temp;
@@ -376,7 +376,7 @@
 }
 
 gboolean
-qof_backend_commit_exists(QofBackend *be)
+qof_backend_commit_exists(const QofBackend *be)
 {
 	if(!be) { return FALSE; }
 	if(be->commit) { return TRUE; }
@@ -393,6 +393,7 @@
 	g_return_val_if_fail(g_module_supported(), FALSE);
 	fullpath = g_module_build_path(directory, module_name);
 	backend = g_module_open(fullpath, G_MODULE_BIND_LAZY);
+	g_free(fullpath);
 	if (!backend) {
 		g_message ("%s: %s\n", PACKAGE, g_module_error ());
 		return FALSE;

Modified: gnucash/branches/gda-dev2/lib/libqof/qof/qofbackend.h
===================================================================
--- gnucash/branches/gda-dev2/lib/libqof/qof/qofbackend.h	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/lib/libqof/qof/qofbackend.h	2007-12-30 15:12:16 UTC (rev 16768)
@@ -165,11 +165,11 @@
 
 void qof_backend_run_begin(QofBackend *be, QofInstance *inst);
 
-gboolean qof_backend_begin_exists(QofBackend *be);
+gboolean qof_backend_begin_exists(const QofBackend *be);
 
 void qof_backend_run_commit(QofBackend *be, QofInstance *inst);
 
-gboolean qof_backend_commit_exists(QofBackend *be);
+gboolean qof_backend_commit_exists(const QofBackend *be);
 //@}
 
 /** The qof_backend_set_error() routine pushes an error code onto the error
@@ -214,7 +214,7 @@
 void qof_backend_prepare_frame(QofBackend *be);
 
 /** Add an option to the backend_configuration. Repeat for more. */
-void qof_backend_prepare_option(QofBackend *be, QofBackendOption *option);
+void qof_backend_prepare_option(QofBackend *be, const QofBackendOption *option);
 
 /** Complete the backend_configuration and return the frame. */
 KvpFrame* qof_backend_complete_frame(QofBackend *be);

Modified: gnucash/branches/gda-dev2/lib/libqof/qof/qofbook.c
===================================================================
--- gnucash/branches/gda-dev2/lib/libqof/qof/qofbook.c	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/lib/libqof/qof/qofbook.c	2007-12-30 15:12:16 UTC (rev 16768)
@@ -366,7 +366,7 @@
 }
 
 gint64
-qof_book_get_counter (QofBook *book, const char *counter_name)
+qof_book_get_counter (const QofBook *book, const char *counter_name)
 {
   QofBackend *be;
   KvpFrame *kvp;

Modified: gnucash/branches/gda-dev2/lib/libqof/qof/qofbook.h
===================================================================
--- gnucash/branches/gda-dev2/lib/libqof/qof/qofbook.h	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/lib/libqof/qof/qofbook.h	2007-12-30 15:12:16 UTC (rev 16768)
@@ -264,7 +264,7 @@
 /** This will 'get and increment' the named counter for this book.
  * The return value is -1 on error or the incremented counter.
  */
-gint64 qof_book_get_counter (QofBook *book, const char *counter_name);
+gint64 qof_book_get_counter (const QofBook *book, const char *counter_name);
 
 /** deprecated */
 #define qof_book_get_guid(X) qof_entity_get_guid (QOF_INSTANCE(X))

Modified: gnucash/branches/gda-dev2/lib/libqof/qof/qofbookmerge.c
===================================================================
--- gnucash/branches/gda-dev2/lib/libqof/qof/qofbookmerge.c	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/lib/libqof/qof/qofbookmerge.c	2007-12-30 15:12:16 UTC (rev 16768)
@@ -627,7 +627,7 @@
  * Returns the corresponding target entity to the given importEnt
  */
 static QofInstance*
-qof_book_merge_map_entity(QofBookMergeData *mergeData, QofInstance* importEnt)
+qof_book_merge_map_entity(const QofBookMergeData *mergeData, const QofInstance* importEnt)
 {
     QofBookMergeRule *currentRule;
     GList *node;

Modified: gnucash/branches/gda-dev2/lib/libqof/qof/qofid.c
===================================================================
--- gnucash/branches/gda-dev2/lib/libqof/qof/qofid.c	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/lib/libqof/qof/qofid.c	2007-12-30 15:12:16 UTC (rev 16768)
@@ -260,11 +260,11 @@
 }
 
 QofCollection *
-qof_collection_from_glist (QofIdType type, GList *glist)
+qof_collection_from_glist (QofIdType type, const GList *glist)
 {
 	QofCollection *coll;
 	QofInstance *ent;
-	GList *list;
+	const GList *list;
 
 	coll = qof_collection_new(type);
 	for(list = glist; list != NULL; list = list->next)

Modified: gnucash/branches/gda-dev2/lib/libqof/qof/qofid.h
===================================================================
--- gnucash/branches/gda-dev2/lib/libqof/qof/qofid.h	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/lib/libqof/qof/qofid.h	2007-12-30 15:12:16 UTC (rev 16768)
@@ -252,7 +252,7 @@
 	on success.
 */
 QofCollection*
-qof_collection_from_glist (QofIdType type, GList *glist);
+qof_collection_from_glist (QofIdType type, const GList *glist);
 
 /** @} */
 /** @} */

Modified: gnucash/branches/gda-dev2/lib/libqof/qof/qofinstance.c
===================================================================
--- gnucash/branches/gda-dev2/lib/libqof/qof/qofinstance.c	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/lib/libqof/qof/qofinstance.c	2007-12-30 15:12:16 UTC (rev 16768)
@@ -633,7 +633,7 @@
 }
 
 gboolean
-qof_instance_check_edit(const  QofInstance *inst)
+qof_instance_check_edit(const QofInstance *inst)
 {
     g_return_val_if_fail(QOF_IS_INSTANCE(inst), FALSE);
     return (GET_PRIVATE(inst)->editlevel > 0);

Modified: gnucash/branches/gda-dev2/lib/libqof/qof/qoflog.c
===================================================================
--- gnucash/branches/gda-dev2/lib/libqof/qof/qoflog.c	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/lib/libqof/qof/qoflog.c	2007-12-30 15:12:16 UTC (rev 16768)
@@ -382,7 +382,7 @@
 }
 
 QofLogLevel
-qof_log_level_from_string(gchar *str)
+qof_log_level_from_string(const gchar *str)
 {
      if (g_ascii_strncasecmp("error", str, 5) == 0) return QOF_LOG_FATAL;
      if (g_ascii_strncasecmp("crit", str, 4) == 0) return QOF_LOG_ERROR;

Modified: gnucash/branches/gda-dev2/lib/libqof/qof/qoflog.h
===================================================================
--- gnucash/branches/gda-dev2/lib/libqof/qof/qoflog.h	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/lib/libqof/qof/qoflog.h	2007-12-30 15:12:16 UTC (rev 16768)
@@ -101,7 +101,7 @@
 DEFINE_ENUM (QofLogLevel, LOG_LEVEL_LIST)
 
 gchar* qof_log_level_to_string(QofLogLevel lvl);
-QofLogLevel qof_log_level_from_string(gchar *str);
+QofLogLevel qof_log_level_from_string(const gchar *str);
 
 /** Indents one level; see ENTER macro. **/
 void qof_log_indent(void);

Modified: gnucash/branches/gda-dev2/lib/libqof/qof/qofquery-p.h
===================================================================
--- gnucash/branches/gda-dev2/lib/libqof/qof/qofquery-p.h	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/lib/libqof/qof/qofquery-p.h	2007-12-30 15:12:16 UTC (rev 16768)
@@ -30,7 +30,7 @@
 typedef struct _QofQuerySort QofQuerySort;
 
 /* Functions to get Query information */
-int qof_query_get_max_results (QofQuery *q);
+int qof_query_get_max_results (const QofQuery *q);
 
 
 /* Functions to get and look at QueryTerms */
@@ -43,11 +43,11 @@
  * Note that you should NOT modify this list in any way.  It belongs
  * to the query.
  */
-GList * qof_query_get_terms (QofQuery *q);
+GList * qof_query_get_terms (const QofQuery *q);
 
-GSList * qof_query_term_get_param_path (QofQueryTerm *queryterm);
-QofQueryPredData *qof_query_term_get_pred_data (QofQueryTerm *queryterm);
-gboolean qof_query_term_is_inverted (QofQueryTerm *queryterm);
+GSList * qof_query_term_get_param_path (const QofQueryTerm *queryterm);
+QofQueryPredData *qof_query_term_get_pred_data (const QofQueryTerm *queryterm);
+gboolean qof_query_term_is_inverted (const QofQueryTerm *queryterm);
 
 
 /* Functions to get and look at QuerySorts */
@@ -58,8 +58,8 @@
 void qof_query_get_sorts (QofQuery *q, QofQuerySort **primary,
                        QofQuerySort **secondary, QofQuerySort **tertiary);
 
-GSList * qof_query_sort_get_param_path (QofQuerySort *querysort);
-gint qof_query_sort_get_sort_options (QofQuerySort *querysort);
-gboolean qof_query_sort_get_increasing (QofQuerySort *querysort);
+GSList * qof_query_sort_get_param_path (const QofQuerySort *querysort);
+gint qof_query_sort_get_sort_options (const QofQuerySort *querysort);
+gboolean qof_query_sort_get_increasing (const QofQuerySort *querysort);
 
 #endif /* QOF_QUERY_P_H */

Modified: gnucash/branches/gda-dev2/lib/libqof/qof/qofquery.c
===================================================================
--- gnucash/branches/gda-dev2/lib/libqof/qof/qofquery.c	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/lib/libqof/qof/qofquery.c	2007-12-30 15:12:16 UTC (rev 16768)
@@ -180,7 +180,7 @@
   g_free (qt);
 }
 
-static QofQueryTerm * copy_query_term (QofQueryTerm *qt)
+static QofQueryTerm * copy_query_term (const QofQueryTerm *qt)
 {
   QofQueryTerm *new_qt;
   if (!qt) return NULL;
@@ -193,10 +193,10 @@
   return new_qt;
 }
 
-static GList * copy_and_terms (GList *and_terms)
+static GList * copy_and_terms (const GList *and_terms)
 {
   GList *and = NULL;
-  GList *cur_and;
+  const GList *cur_and;
 
   for(cur_and = and_terms; cur_and; cur_and = cur_and->next)
   {
@@ -207,10 +207,10 @@
 }
 
 static GList * 
-copy_or_terms(GList * or_terms) 
+copy_or_terms(const GList * or_terms) 
 {
   GList * or = NULL;
-  GList * cur_or;
+  const GList * cur_or;
 
   for(cur_or = or_terms; cur_or; cur_or = cur_or->next)
   {
@@ -270,8 +270,8 @@
   q->results = NULL;
 }
 
-static int cmp_func (QofQuerySort *sort, QofSortFunc default_sort,
-                     gconstpointer a, gconstpointer b)
+static int cmp_func (const QofQuerySort *sort, QofSortFunc default_sort,
+                     const gconstpointer a, const gconstpointer b)
 {
   QofParam *param = NULL;
   GSList *node;
@@ -319,10 +319,10 @@
   return sort->obj_cmp (conva, convb);
 }
 
-static int sort_func (gconstpointer a, gconstpointer b, gpointer q)
+static int sort_func (const gconstpointer a, const gconstpointer b, const gpointer q)
 {
   int retval;
-  QofQuery *sortQuery = q;
+  const QofQuery *sortQuery = q;
 
   g_return_val_if_fail (sortQuery, 0);
 
@@ -355,11 +355,11 @@
  */
 
 static int 
-check_object (QofQuery *q, gpointer object)
+check_object (const QofQuery *q, gpointer object)
 {
-  GList     * and_ptr;
-  GList     * or_ptr;
-  QofQueryTerm * qt;
+  const GList     * and_ptr;
+  const GList     * or_ptr;
+  const QofQueryTerm * qt;
   int       and_terms_ok=1;
   
   for(or_ptr = q->terms; or_ptr; or_ptr = or_ptr->next) 
@@ -370,7 +370,7 @@
       qt = (QofQueryTerm *)(and_ptr->data);
       if (qt->param_fcns && qt->pred_fcn) 
       {
-        GSList *node;
+        const GSList *node;
         QofParam *param = NULL;
         gpointer conv_obj = object;
 
@@ -556,7 +556,7 @@
   return;
 }
 
-static int param_list_cmp (GSList *l1, GSList *l2)
+static int param_list_cmp (const GSList *l1, const GSList *l2)
 {
   while (1) {
     int ret;
@@ -1311,39 +1311,39 @@
   qof_query_core_shutdown ();
 }
 
-int qof_query_get_max_results (QofQuery *q)
+int qof_query_get_max_results (const QofQuery *q)
 {
   if (!q) return 0;
   return q->max_results;
 }
 
-QofIdType qof_query_get_search_for (QofQuery *q)
+QofIdType qof_query_get_search_for (const QofQuery *q)
 {
   if (!q) return NULL;
   return q->search_for;
 }
 
-GList * qof_query_get_terms (QofQuery *q)
+GList * qof_query_get_terms (const QofQuery *q)
 {
   if (!q) return NULL;
   return q->terms;
 }
 
-GSList * qof_query_term_get_param_path (QofQueryTerm *qt)
+GSList * qof_query_term_get_param_path (const QofQueryTerm *qt)
 {
   if (!qt)
     return NULL;
   return qt->param_list;
 }
 
-QofQueryPredData *qof_query_term_get_pred_data (QofQueryTerm *qt)
+QofQueryPredData *qof_query_term_get_pred_data (const QofQueryTerm *qt)
 {
   if (!qt)
     return NULL;
   return qt->pdata;
 }
 
-gboolean qof_query_term_is_inverted (QofQueryTerm *qt)
+gboolean qof_query_term_is_inverted (const QofQueryTerm *qt)
 {
   if (!qt)
     return FALSE;
@@ -1363,21 +1363,21 @@
     *tertiary = &(q->tertiary_sort);
 }
 
-GSList * qof_query_sort_get_param_path (QofQuerySort *qs)
+GSList * qof_query_sort_get_param_path (const QofQuerySort *qs)
 {
   if (!qs)
     return NULL;
   return qs->param_list;
 }
 
-gint qof_query_sort_get_sort_options (QofQuerySort *qs)
+gint qof_query_sort_get_sort_options (const QofQuerySort *qs)
 {
   if (!qs)
     return 0;
   return qs->options;
 }
 
-gboolean qof_query_sort_get_increasing (QofQuerySort *qs)
+gboolean qof_query_sort_get_increasing (const QofQuerySort *qs)
 {
   if (!qs)
     return FALSE;
@@ -1385,7 +1385,7 @@
 }
 
 static gboolean 
-qof_query_term_equal (QofQueryTerm *qt1, QofQueryTerm *qt2)
+qof_query_term_equal (const QofQueryTerm *qt1, const QofQueryTerm *qt2)
 {
   if (qt1 == qt2) return TRUE;
   if (!qt1 || !qt2) return FALSE;
@@ -1396,7 +1396,7 @@
 }
 
 static gboolean 
-qof_query_sort_equal (QofQuerySort* qs1, QofQuerySort* qs2)
+qof_query_sort_equal (const QofQuerySort* qs1, const QofQuerySort* qs2)
 {
   if (qs1 == qs2) return TRUE;
   if (!qs1 || !qs2) return FALSE;
@@ -1409,7 +1409,7 @@
   return (param_list_cmp (qs1->param_list, qs2->param_list) == 0);
 }
 
-gboolean qof_query_equal (QofQuery *q1, QofQuery *q2)
+gboolean qof_query_equal (const QofQuery *q1, const QofQuery *q2)
 {
   GList *or1, *or2;
 

Modified: gnucash/branches/gda-dev2/lib/libqof/qof/qofquery.h
===================================================================
--- gnucash/branches/gda-dev2/lib/libqof/qof/qofquery.h	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/lib/libqof/qof/qofquery.h	2007-12-30 15:12:16 UTC (rev 16768)
@@ -360,7 +360,7 @@
  * implementation -- logical equivalences between different
  * and/or trees are ignored. 
  */
-gboolean qof_query_equal (QofQuery *q1, QofQuery *q2);
+gboolean qof_query_equal (const QofQuery *q1, const QofQuery *q2);
 
 /** Log the Query 
  *
@@ -371,7 +371,7 @@
 void qof_query_print (QofQuery *query);
 
 /** Return the type of data we're querying for */
-QofIdType qof_query_get_search_for (QofQuery *q);
+QofIdType qof_query_get_search_for (const QofQuery *q);
 
 /** Return the list of books we're using */
 GList * qof_query_get_books (QofQuery *q);

Modified: gnucash/branches/gda-dev2/lib/libqof/qof/qofquerycore-p.h
===================================================================
--- gnucash/branches/gda-dev2/lib/libqof/qof/qofquerycore-p.h	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/lib/libqof/qof/qofquerycore-p.h	2007-12-30 15:12:16 UTC (rev 16768)
@@ -50,7 +50,7 @@
 QofCompareFunc qof_query_core_get_compare (gchar const *type);
 
 /* Compare two predicates */
-gboolean qof_query_core_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2);
+gboolean qof_query_core_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2);
 
 /* Predicate Data Structures:
  *

Modified: gnucash/branches/gda-dev2/lib/libqof/qof/qofquerycore.c
===================================================================
--- gnucash/branches/gda-dev2/lib/libqof/qof/qofquerycore.c	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/lib/libqof/qof/qofquerycore.c	2007-12-30 15:12:16 UTC (rev 16768)
@@ -35,7 +35,7 @@
 typedef void (*QueryPredDataFree) (QofQueryPredData *pdata);
 
 /* A function to copy a query's predicate data */
-typedef QofQueryPredData *(*QueryPredicateCopyFunc) (QofQueryPredData *pdata);
+typedef QofQueryPredData *(*QueryPredicateCopyFunc) (const QofQueryPredData *pdata);
 
 /* A function to take the object, apply the getter->param_getfcn,
  * and return a printable string.  Note that this QofParam->getfnc
@@ -46,8 +46,8 @@
 typedef char * (*QueryToString) (gpointer object, QofParam *getter);
 
 /* A function to test for equality of predicate data */
-typedef gboolean (*QueryPredicateEqual) (QofQueryPredData *p1,
-                                         QofQueryPredData *p2);
+typedef gboolean (*QueryPredicateEqual) (const QofQueryPredData *p1,
+                                         const QofQueryPredData *p2);
 
 static QueryPredicateCopyFunc qof_query_copy_predicate (QofType type);
 static QueryPredDataFree qof_query_predicate_free (QofType type);
@@ -222,16 +222,15 @@
 
   if (pdata->is_regex)
     regfree (&pdata->compiled);
-  else
-    g_free (pdata->matchstring);
 
+  g_free (pdata->matchstring);
   g_free (pdata);
 }
 
 static QofQueryPredData *
-string_copy_predicate (QofQueryPredData *pd)
+string_copy_predicate (const QofQueryPredData *pd)
 {
-  query_string_t pdata = (query_string_t) pd;
+  const query_string_t pdata = (const query_string_t) pd;
 
   VERIFY_PDATA_R (query_string_type);
 
@@ -241,10 +240,10 @@
 }
 
 static gboolean
-string_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+string_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
-  query_string_t pd1 = (query_string_t) p1;
-  query_string_t pd2 = (query_string_t) p2;
+  const query_string_t pd1 = (const query_string_t) p1;
+  const query_string_t pd2 = (const query_string_t) p2;
 
   if (pd1->options != pd2->options) return FALSE;
   if (pd1->is_regex != pd2->is_regex) return FALSE;
@@ -376,9 +375,9 @@
 }
 
 static QofQueryPredData *
-date_copy_predicate (QofQueryPredData *pd)
+date_copy_predicate (const QofQueryPredData *pd)
 {
-  query_date_t pdata = (query_date_t)pd;
+  const query_date_t pdata = (const query_date_t)pd;
 
   VERIFY_PDATA_R (query_date_type);
 
@@ -386,10 +385,10 @@
 }
 
 static gboolean
-date_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+date_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
-  query_date_t pd1 = (query_date_t) p1;
-  query_date_t pd2 = (query_date_t) p2;
+  const query_date_t pd1 = (const query_date_t) p1;
+  const query_date_t pd2 = (const query_date_t) p2;
 
   if (pd1->options != pd2->options) return FALSE;
   return timespec_equal (&(pd1->date), &(pd2->date));
@@ -410,9 +409,9 @@
 }
 
 gboolean
-qof_query_date_predicate_get_date (QofQueryPredData *pd, Timespec *date)
+qof_query_date_predicate_get_date (const QofQueryPredData *pd, Timespec *date)
 {
-  query_date_t pdata = (query_date_t)pd;
+  const query_date_t pdata = (const query_date_t)pd;
 
   if (pdata->pd.type_name != query_date_type)
     return FALSE;
@@ -510,18 +509,18 @@
 }
 
 static QofQueryPredData *
-numeric_copy_predicate (QofQueryPredData *pd)
+numeric_copy_predicate (const QofQueryPredData *pd)
 {
-  query_numeric_t pdata = (query_numeric_t)pd;
+  const query_numeric_t pdata = (const query_numeric_t)pd;
   VERIFY_PDATA_R (query_numeric_type);
   return qof_query_numeric_predicate (pd->how, pdata->options, pdata->amount);
 }
 
 static gboolean
-numeric_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+numeric_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
-  query_numeric_t pd1 = (query_numeric_t) p1;
-  query_numeric_t pd2 = (query_numeric_t) p2;
+  const query_numeric_t pd1 = (const query_numeric_t) p1;
+  const query_numeric_t pd2 = (const query_numeric_t) p2;
 
   if (pd1->options != pd2->options) return FALSE;
   return gnc_numeric_equal (pd1->amount, pd2->amount);
@@ -685,18 +684,18 @@
 }
 
 static QofQueryPredData *
-guid_copy_predicate (QofQueryPredData *pd)
+guid_copy_predicate (const QofQueryPredData *pd)
 {
-  query_guid_t pdata = (query_guid_t)pd;
+  const query_guid_t pdata = (const query_guid_t)pd;
   VERIFY_PDATA_R (query_guid_type);
   return qof_query_guid_predicate (pdata->options, pdata->guids);
 }
 
 static gboolean
-guid_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+guid_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
-  query_guid_t pd1 = (query_guid_t) p1;
-  query_guid_t pd2 = (query_guid_t) p2;
+  const query_guid_t pd1 = (const query_guid_t) p1;
+  const query_guid_t pd2 = (const query_guid_t) p2;
   GList *l1 = pd1->guids, *l2 = pd2->guids;
 
   if (pd1->options != pd2->options) return FALSE;
@@ -789,18 +788,18 @@
 }
 
 static QofQueryPredData *
-int32_copy_predicate (QofQueryPredData *pd)
+int32_copy_predicate (const QofQueryPredData *pd)
 {
-  query_int32_t pdata = (query_int32_t)pd;
+  const query_int32_t pdata = (const query_int32_t)pd;
   VERIFY_PDATA_R (query_int32_type);
   return qof_query_int32_predicate (pd->how, pdata->val);
 }
 
 static gboolean
-int32_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+int32_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
-  query_int32_t pd1 = (query_int32_t) p1;
-  query_int32_t pd2 = (query_int32_t) p2;
+  const query_int32_t pd1 = (const query_int32_t) p1;
+  const query_int32_t pd2 = (const query_int32_t) p2;
 
   return (pd1->val == pd2->val);
 }
@@ -880,18 +879,18 @@
 }
 
 static QofQueryPredData *
-int64_copy_predicate (QofQueryPredData *pd)
+int64_copy_predicate (const QofQueryPredData *pd)
 {
-  query_int64_t pdata = (query_int64_t)pd;
+  const query_int64_t pdata = (const query_int64_t)pd;
   VERIFY_PDATA_R (query_int64_type);
   return qof_query_int64_predicate (pd->how, pdata->val);
 }
 
 static gboolean
-int64_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+int64_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
-  query_int64_t pd1 = (query_int64_t) p1;
-  query_int64_t pd2 = (query_int64_t) p2;
+  const query_int64_t pd1 = (const query_int64_t) p1;
+  const query_int64_t pd2 = (const query_int64_t) p2;
 
   return (pd1->val == pd2->val);
 }
@@ -971,18 +970,18 @@
 }
 
 static QofQueryPredData *
-double_copy_predicate (QofQueryPredData *pd)
+double_copy_predicate (const QofQueryPredData *pd)
 {
-  query_double_t pdata = (query_double_t)pd;
+  const query_double_t pdata = (const query_double_t)pd;
   VERIFY_PDATA_R (query_double_type);
   return qof_query_double_predicate (pd->how, pdata->val);
 }
 
 static gboolean
-double_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+double_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
-  query_double_t pd1 = (query_double_t) p1;
-  query_double_t pd2 = (query_double_t) p2;
+  const query_double_t pd1 = (const query_double_t) p1;
+  const query_double_t pd2 = (const query_double_t) p2;
 
   return (pd1->val == pd2->val);
 }
@@ -1051,18 +1050,18 @@
 }
 
 static QofQueryPredData *
-boolean_copy_predicate (QofQueryPredData *pd)
+boolean_copy_predicate (const QofQueryPredData *pd)
 {
-  query_boolean_t pdata = (query_boolean_t)pd;
+  const query_boolean_t pdata = (const query_boolean_t)pd;
   VERIFY_PDATA_R (query_boolean_type);
   return qof_query_boolean_predicate (pd->how, pdata->val);
 }
 
 static gboolean
-boolean_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+boolean_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
-  query_boolean_t pd1 = (query_boolean_t) p1;
-  query_boolean_t pd2 = (query_boolean_t) p2;
+  const query_boolean_t pd1 = (const query_boolean_t) p1;
+  const query_boolean_t pd2 = (const query_boolean_t) p2;
 
   return (pd1->val == pd2->val);
 }
@@ -1134,18 +1133,18 @@
 }
 
 static QofQueryPredData *
-char_copy_predicate (QofQueryPredData *pd)
+char_copy_predicate (const QofQueryPredData *pd)
 {
-  query_char_t pdata = (query_char_t)pd;
+  const query_char_t pdata = (const query_char_t)pd;
   VERIFY_PDATA_R (query_char_type);
   return qof_query_char_predicate (pdata->options, pdata->char_list);
 }
 
 static gboolean
-char_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+char_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
-  query_char_t pd1 = (query_char_t) p1;
-  query_char_t pd2 = (query_char_t) p2;
+  const query_char_t pd1 = (const query_char_t) p1;
+  const query_char_t pd2 = (const query_char_t) p2;
 
   if (pd1->options != pd2->options) return FALSE;
   return (safe_strcmp (pd1->char_list, pd2->char_list) == 0);
@@ -1236,18 +1235,18 @@
 }
 
 static QofQueryPredData *
-kvp_copy_predicate (QofQueryPredData *pd)
+kvp_copy_predicate (const QofQueryPredData *pd)
 {
-  query_kvp_t pdata = (query_kvp_t)pd;
+  const query_kvp_t pdata = (const query_kvp_t)pd;
   VERIFY_PDATA_R (query_kvp_type);
   return qof_query_kvp_predicate (pd->how, pdata->path, pdata->value);
 }
 
 static gboolean
-kvp_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+kvp_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
-  query_kvp_t pd1 = (query_kvp_t) p1;
-  query_kvp_t pd2 = (query_kvp_t) p2;
+  const query_kvp_t pd1 = (const query_kvp_t) p1;
+  const query_kvp_t pd2 = (const query_kvp_t) p2;
   GSList *n1, *n2;
 
   n1 = pd1->path;
@@ -1427,23 +1426,21 @@
 }
 
 static QofQueryPredData *
-collect_copy_predicate (QofQueryPredData *pd)
+collect_copy_predicate (const QofQueryPredData *pd)
 {
-	query_coll_t pdata = (query_coll_t) pd;
+	const query_coll_t pdata = (const query_coll_t) pd;
 
 	VERIFY_PDATA_R (query_collect_type);
 	return qof_query_collect_predicate (pdata->options, pdata->coll);
 }
 
 static gboolean
-collect_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+collect_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
-	query_coll_t pd1;
-	query_coll_t pd2;
+	const query_coll_t pd1 = (const query_coll_t) p1;
+	const query_coll_t pd2 = (const query_coll_t) p2;
 	gint result;
 
-	pd1 = (query_coll_t) p1;
-	pd2 = (query_coll_t) p2;
 	result = qof_collection_compare(pd1->coll, pd2->coll);
 	if(result == 0) { return TRUE; }
 	return FALSE;
@@ -1589,18 +1586,18 @@
 }
 
 static QofQueryPredData *
-choice_copy_predicate (QofQueryPredData *pd)
+choice_copy_predicate (const QofQueryPredData *pd)
 {
-  query_choice_t pdata = (query_choice_t)pd;
+  const query_choice_t pdata = (const query_choice_t)pd;
   VERIFY_PDATA_R (query_choice_type);
   return qof_query_choice_predicate (pdata->options, pdata->guids);
 }
 
 static gboolean
-choice_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+choice_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
-  query_choice_t pd1 = (query_choice_t) p1;
-  query_choice_t pd2 = (query_choice_t) p2;
+  const query_choice_t pd1 = (const query_choice_t) p1;
+  const query_choice_t pd2 = (const query_choice_t) p2;
   GList *l1 = pd1->guids, *l2 = pd2->guids;
 
   if (pd1->options != pd2->options) return FALSE;
@@ -1822,7 +1819,7 @@
 }
 
 QofQueryPredData *
-qof_query_core_predicate_copy (QofQueryPredData *pdata)
+qof_query_core_predicate_copy (const QofQueryPredData *pdata)
 {
   QueryPredicateCopyFunc copy;
 
@@ -1850,7 +1847,7 @@
 }
 
 gboolean
-qof_query_core_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+qof_query_core_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
   QueryPredicateEqual pred_equal;
 

Modified: gnucash/branches/gda-dev2/lib/libqof/qof/qofquerycore.h
===================================================================
--- gnucash/branches/gda-dev2/lib/libqof/qof/qofquerycore.h	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/lib/libqof/qof/qofquerycore.h	2007-12-30 15:12:16 UTC (rev 16768)
@@ -175,13 +175,13 @@
                                                 const KvpValue *value);
 
 /** Copy a predicate. */
-QofQueryPredData *qof_query_core_predicate_copy (QofQueryPredData *pdata);
+QofQueryPredData *qof_query_core_predicate_copy (const QofQueryPredData *pdata);
 
 /** Destroy a predicate. */
 void qof_query_core_predicate_free (QofQueryPredData *pdata);
 
 /** Retrieve a predicate. */
-gboolean qof_query_date_predicate_get_date (QofQueryPredData *pd, Timespec *date);
+gboolean qof_query_date_predicate_get_date (const QofQueryPredData *pd, Timespec *date);
 /** Return a printable string for a core data object.  Caller needs
  *  to g_free() the returned string.
  */

Modified: gnucash/branches/gda-dev2/lib/libqof/qof/qofsession-p.h
===================================================================
--- gnucash/branches/gda-dev2/lib/libqof/qof/qofsession-p.h	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/lib/libqof/qof/qofsession-p.h	2007-12-30 15:12:16 UTC (rev 16768)
@@ -67,7 +67,7 @@
 };
 
 
-QofBackend * qof_session_get_backend (QofSession *session);
+QofBackend * qof_session_get_backend (const QofSession *session);
 
 void qof_session_push_error (QofSession *session, QofBackendError err,
                              const char *message);

Modified: gnucash/branches/gda-dev2/lib/libqof/qof/qofsession.c
===================================================================
--- gnucash/branches/gda-dev2/lib/libqof/qof/qofsession.c	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/lib/libqof/qof/qofsession.c	2007-12-30 15:12:16 UTC (rev 16768)
@@ -165,7 +165,7 @@
 }
 
 const char *
-qof_session_get_error_message(QofSession *session)
+qof_session_get_error_message(const QofSession *session)
 {
     if(!session) return "";
     if(!session->error_message)
@@ -234,7 +234,7 @@
 }
 
 QofBook *
-qof_session_get_book (QofSession *session)
+qof_session_get_book (const QofSession *session)
 {
    GList *node;
    if (!session) return NULL;
@@ -282,14 +282,14 @@
 }
 
 QofBackend * 
-qof_session_get_backend (QofSession *session)
+qof_session_get_backend (const QofSession *session)
 {
    if (!session) return NULL;
    return session->backend;
 }
 
 const char *
-qof_session_get_file_path (QofSession *session)
+qof_session_get_file_path (const QofSession *session)
 {
    if (!session) return NULL;
    if (!session->backend) return NULL;
@@ -297,7 +297,7 @@
 }
 
 const char *
-qof_session_get_url (QofSession *session)
+qof_session_get_url (const QofSession *session)
 {
    if (!session) return NULL;
    return session->book_id;
@@ -865,7 +865,7 @@
 };
 
 static void
-qof_session_load_backend(QofSession * session, char * access_method)
+qof_session_load_backend(QofSession * session, const char * access_method)
 {
 	GSList *p;
 	GList *node;
@@ -1176,7 +1176,7 @@
 /* ====================================================================== */
 
 gboolean
-qof_session_save_may_clobber_data (QofSession *session)
+qof_session_save_may_clobber_data (const QofSession *session)
 {
   if (!session) return FALSE;
   if (!session->backend) return FALSE;
@@ -1447,7 +1447,7 @@
 /* ====================================================================== */
 
 gboolean
-qof_session_events_pending (QofSession *session)
+qof_session_events_pending (const QofSession *session)
 {
   if (!session) return FALSE;
   if (!session->backend) return FALSE;

Modified: gnucash/branches/gda-dev2/lib/libqof/qof/qofsession.h
===================================================================
--- gnucash/branches/gda-dev2/lib/libqof/qof/qofsession.h	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/lib/libqof/qof/qofsession.h	2007-12-30 15:12:16 UTC (rev 16768)
@@ -173,7 +173,7 @@
  *    for any failure.  Calling this routine returns the current error.
  */
 QofBackendError qof_session_get_error (QofSession *session);
-const char * qof_session_get_error_message(QofSession *session);
+const char * qof_session_get_error_message(const QofSession *session);
 
 /**
  * The qof_session_pop_error() routine can be used to obtain the reason
@@ -197,7 +197,7 @@
  */
 void qof_session_add_book (QofSession *session, QofBook *book);
 
-QofBook * qof_session_get_book (QofSession *session);
+QofBook * qof_session_get_book (const QofSession *session);
 
 /**
  *    The qof_session_get_file_path() routine returns the fully-qualified file
@@ -213,9 +213,9 @@
  *    URL's for local files take the form of 
  *    file:/some/where/some/file.gml
  */
-const char * qof_session_get_file_path (QofSession *session);
+const char * qof_session_get_file_path (const QofSession *session);
 
-const char * qof_session_get_url (QofSession *session);
+const char * qof_session_get_url (const QofSession *session);
 
 /**
  * The qof_session_not_saved() subroutine will return TRUE
@@ -225,7 +225,7 @@
 gboolean qof_session_save_in_progress(QofSession *session);
 
 /** Allows the backend to warn the user if a dataset already exists. */
-gboolean qof_session_save_may_clobber_data (QofSession *session);
+gboolean qof_session_save_may_clobber_data (const QofSession *session);
 
 /** The qof_session_save() method will commit all changes that have been
  *    made to the session. For the file backend, this is nothing
@@ -409,7 +409,7 @@
  *  backend has pending events which must be processed to bring 
  *  the engine up to date with the backend.
  */
-gboolean qof_session_events_pending (QofSession *session);
+gboolean qof_session_events_pending (const QofSession *session);
 
 /**  The qof_session_process_events() method will process any events
  *   indicated by the qof_session_events_pending() method. It returns 

Modified: gnucash/branches/gda-dev2/po/POTFILES.skip
===================================================================
--- gnucash/branches/gda-dev2/po/POTFILES.skip	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/po/POTFILES.skip	2007-12-30 15:12:16 UTC (rev 16768)
@@ -12,3 +12,6 @@
 src/import-export/binary-import/binary-import.glade
 src/import-export/binary-import/druid-commodity.c
 src/import-export/binary-import/gncmod-binary-import.c
+# The features in import-export/qif are still unused.
+src/import-export/qif/qif-defaults.c
+src/import-export/qif/qif-parse.c

Modified: gnucash/branches/gda-dev2/src/app-utils/gnc-sx-instance-model.c
===================================================================
--- gnucash/branches/gda-dev2/src/app-utils/gnc-sx-instance-model.c	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/src/app-utils/gnc-sx-instance-model.c	2007-12-30 15:12:16 UTC (rev 16768)
@@ -261,7 +261,7 @@
 gnc_sx_get_template_transaction_account(SchedXaction *sx)
 {
     Account *template_root, *sx_template_acct;
-    char sx_guid_str[GUID_ENCODING_LENGTH];
+    char sx_guid_str[GUID_ENCODING_LENGTH+1];
 
     template_root = gnc_book_get_template_root(gnc_get_current_book());
     guid_to_string_buff(xaccSchedXactionGetGUID(sx), sx_guid_str);
@@ -923,7 +923,7 @@
     *split_acct = xaccAccountLookup(acct_guid, gnc_get_current_book());
     if (*split_acct == NULL)
     {
-        char guid_str[GUID_ENCODING_LENGTH];
+        char guid_str[GUID_ENCODING_LENGTH+1];
         GString *err;
         guid_to_string_buff((const GUID*)acct_guid, guid_str);
         err = g_string_new("");

Modified: gnucash/branches/gda-dev2/src/engine/cap-gains.c
===================================================================
--- gnucash/branches/gda-dev2/src/engine/cap-gains.c	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/src/engine/cap-gains.c	2007-12-30 15:12:16 UTC (rev 16768)
@@ -76,7 +76,7 @@
 /* ============================================================== */
 
 gboolean 
-xaccAccountHasTrades (Account *acc)
+xaccAccountHasTrades (const Account *acc)
 {
    gnc_commodity *acc_comm;
    SplitList *splits, *node;
@@ -266,7 +266,7 @@
 /* ============================================================== */
 
 void
-xaccAccountSetDefaultGainAccount (Account *acc, Account *gain_acct)
+xaccAccountSetDefaultGainAccount (Account *acc, const Account *gain_acct)
 {
   KvpFrame *cwd;
   KvpValue *vvv;
@@ -292,7 +292,7 @@
 /* ============================================================== */
 
 Account *
-xaccAccountGetDefaultGainAccount (Account *acc, gnc_commodity * currency)
+xaccAccountGetDefaultGainAccount (const Account *acc, const gnc_commodity * currency)
 {
   Account *gain_acct = NULL;
   KvpFrame *cwd;

Modified: gnucash/branches/gda-dev2/src/engine/cap-gains.h
===================================================================
--- gnucash/branches/gda-dev2/src/engine/cap-gains.h	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/src/engine/cap-gains.h	2007-12-30 15:12:16 UTC (rev 16768)
@@ -104,7 +104,7 @@
  *    TRUE if this is a trading account, else it returns
  *    FALSE.
  */
-gboolean xaccAccountHasTrades (Account *);
+gboolean xaccAccountHasTrades (const Account *);
 
 /** The xaccAccountFindEarliestOpenLot() method is a handy
  *   utility routine for finding the earliest open lot in
@@ -133,7 +133,7 @@
  *   currency name.  IOf there is no default account for this
  *   currency, NULL will be returned.
  */
-Account * xaccAccountGetDefaultGainAccount (Account *acc, gnc_commodity * currency);
+Account * xaccAccountGetDefaultGainAccount (const Account *acc, const gnc_commodity * currency);
 
 /** The xaccAccountSetDefaultGainAccount() routine can be used 
  *   to set the account to which realized gains/losses will be 
@@ -141,7 +141,7 @@
  *   value of the "/lot-mgmt/gains-act/XXX" key, where XXX is the 
  *   unique currency name of the currency of gains account.
  */
-void xaccAccountSetDefaultGainAccount (Account *acc, Account *gains_acct);
+void xaccAccountSetDefaultGainAccount (Account *acc, const Account *gains_acct);
 
 /** The xaccSplitGetCapGainsSplit() routine returns the split
  *  that records the cap gains for this split.  It returns NULL

Modified: gnucash/branches/gda-dev2/src/engine/engine-helpers.c
===================================================================
--- gnucash/branches/gda-dev2/src/engine/engine-helpers.c	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/src/engine/engine-helpers.c	2007-12-30 15:12:16 UTC (rev 16768)
@@ -47,7 +47,7 @@
 static QofLogModule log_module = GNC_MOD_ENGINE;
 
 Timespec
-gnc_transaction_get_date_posted(Transaction *t) 
+gnc_transaction_get_date_posted(const Transaction *t) 
 {
   Timespec result;
   xaccTransGetDatePostedTS(t, &result);
@@ -55,7 +55,7 @@
 }
 
 Timespec
-gnc_transaction_get_date_entered(Transaction *t) 
+gnc_transaction_get_date_entered(const Transaction *t) 
 {
   Timespec result;
   xaccTransGetDateEnteredTS(t, &result);
@@ -63,7 +63,7 @@
 }
 
 Timespec
-gnc_split_get_date_reconciled(Split *s) 
+gnc_split_get_date_reconciled(const Split *s) 
 {
   Timespec result;
   xaccSplitGetDateReconciledTS(s, &result);
@@ -382,10 +382,10 @@
 }
 
 static SCM
-gnc_guid_glist2scm (GList *account_guids)
+gnc_guid_glist2scm (const GList *account_guids)
 {
   SCM guids = SCM_EOL;
-  GList *node;
+  const GList *node;
 
   for (node = account_guids; node; node = node->next)
   {
@@ -460,10 +460,10 @@
 }
 
 static SCM
-gnc_query_path2scm (GSList *path)
+gnc_query_path2scm (const GSList *path)
 {
   SCM path_scm = SCM_EOL;
-  GSList *node;
+  const GSList *node;
 
   for (node = path; node; node = node->next)
   {
@@ -522,7 +522,7 @@
 static SCM gnc_kvp_frame2scm (KvpFrame *frame);
 
 static SCM
-gnc_kvp_value2scm (KvpValue *value)
+gnc_kvp_value2scm (const KvpValue *value)
 {
   SCM value_scm = SCM_EOL;
   KvpValueType value_t;
@@ -770,7 +770,7 @@
 }
 
 static SCM
-gnc_queryterm2scm (QofQueryTerm *qt)
+gnc_queryterm2scm (const QofQueryTerm *qt)
 {
   SCM qt_scm = SCM_EOL;
   QofQueryPredData *pd = NULL;
@@ -1413,10 +1413,10 @@
 }
 
 static SCM
-gnc_query_terms2scm (GList *terms)
+gnc_query_terms2scm (const GList *terms)
 {
   SCM or_terms = SCM_EOL;
-  GList *or_node;
+  const GList *or_node;
 
   for (or_node = terms; or_node; or_node = or_node->next)
   {
@@ -1524,7 +1524,7 @@
 }
 
 static SCM
-gnc_query_sort2scm (QofQuerySort *qs)
+gnc_query_sort2scm (const QofQuerySort *qs)
 {
   SCM sort_scm = SCM_EOL;
   GSList *path;
@@ -2191,13 +2191,13 @@
 }
 
 SCM
-gnc_book_to_scm (QofBook *book)
+gnc_book_to_scm (const QofBook *book)
 {
     return gnc_generic_to_scm(book, "_p_QofBook");
 }
 
 SCM
-qof_session_to_scm (QofSession *session)
+qof_session_to_scm (const QofSession *session)
 {
     return gnc_generic_to_scm(session, "_p_QofSession");
 }

Modified: gnucash/branches/gda-dev2/src/engine/engine-helpers.h
===================================================================
--- gnucash/branches/gda-dev2/src/engine/engine-helpers.h	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/src/engine/engine-helpers.h	2007-12-30 15:12:16 UTC (rev 16768)
@@ -33,10 +33,10 @@
 #include "Query.h"
 #include "Transaction.h"
 
-Timespec gnc_transaction_get_date_posted(Transaction *t);
-Timespec gnc_transaction_get_date_entered(Transaction *t);
+Timespec gnc_transaction_get_date_posted(const Transaction *t);
+Timespec gnc_transaction_get_date_entered(const Transaction *t);
 
-Timespec gnc_split_get_date_reconciled(Split *s);
+Timespec gnc_split_get_date_reconciled(const Split *s);
 
 void gnc_transaction_set_date_posted(Transaction *t, const Timespec d);
 void gnc_transaction_set_date_entered(Transaction *t, const Timespec d);
@@ -71,7 +71,7 @@
 int gnc_numeric_p(SCM arg);
 gnc_commodity * gnc_scm_to_commodity(SCM scm);
 SCM gnc_commodity_to_scm (const gnc_commodity *commodity);
-SCM gnc_book_to_scm (QofBook *book);
-SCM qof_session_to_scm (QofSession *session);
+SCM gnc_book_to_scm (const QofBook *book);
+SCM qof_session_to_scm (const QofSession *session);
 
 #endif

Modified: gnucash/branches/gda-dev2/src/engine/gnc-commodity.c
===================================================================
--- gnucash/branches/gda-dev2/src/engine/gnc-commodity.c	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/src/engine/gnc-commodity.c	2007-12-30 15:12:16 UTC (rev 16768)
@@ -373,7 +373,7 @@
  * Accessor functions - get functions only. There are no set functions.
  ********************************************************************/
 QuoteSourceType
-gnc_quote_source_get_type (gnc_quote_source *source)
+gnc_quote_source_get_type (const gnc_quote_source *source)
 {
   ENTER("%p", source);
   if (!source) {
@@ -386,7 +386,7 @@
 }
 
 gint
-gnc_quote_source_get_index (gnc_quote_source *source)
+gnc_quote_source_get_index (const gnc_quote_source *source)
 {
   ENTER("%p", source);
   if (!source) {
@@ -399,7 +399,7 @@
 }
 
 gboolean
-gnc_quote_source_get_supported (gnc_quote_source *source)
+gnc_quote_source_get_supported (const gnc_quote_source *source)
 {
   ENTER("%p", source);
   if (!source) {
@@ -412,7 +412,7 @@
 }
 
 const char *
-gnc_quote_source_get_user_name (gnc_quote_source *source)
+gnc_quote_source_get_user_name (const gnc_quote_source *source)
 {
   ENTER("%p", source);
   if (!source) {
@@ -424,7 +424,7 @@
 }
 
 const char *
-gnc_quote_source_get_old_internal_name (gnc_quote_source *source)
+gnc_quote_source_get_old_internal_name (const gnc_quote_source *source)
 {
   ENTER("%p", source);
   if (!source) {
@@ -436,7 +436,7 @@
 }
 
 const char *
-gnc_quote_source_get_internal_name (gnc_quote_source *source)
+gnc_quote_source_get_internal_name (const gnc_quote_source *source)
 {
   ENTER("%p", source);
   if (!source) {
@@ -454,11 +454,11 @@
  * installed.
  ********************************************************************/
 void
-gnc_quote_source_set_fq_installed (GList *sources_list)
+gnc_quote_source_set_fq_installed (const GList *sources_list)
 {
   gnc_quote_source *source;
   char *source_name;
-  GList *node;
+  const GList *node;
 
   ENTER(" ");
   fq_is_installed = TRUE;
@@ -628,7 +628,7 @@
 
   cm->mark = 0;
 
-#if !ACCOUNTS_CLEANED_UP
+#ifdef ACCOUNTS_CLEANED_UP
   /* Account objects are not actually cleaned up when a book is closed (in fact
    * a memory leak), but commodities are, so in currently this warning gets hit
    * quite frequently.  Disable the check until cleaning up of accounts objects
@@ -644,7 +644,7 @@
 }
 
 void
-gnc_commodity_copy(gnc_commodity * dest, gnc_commodity *src)
+gnc_commodity_copy(gnc_commodity * dest, const gnc_commodity *src)
 {
   gnc_commodity_set_fullname (dest, src->fullname);
   dest->namespace = src->namespace;
@@ -658,7 +658,7 @@
 }
 
 gnc_commodity *
-gnc_commodity_clone(gnc_commodity *src, QofBook *dest_book)
+gnc_commodity_clone(const gnc_commodity *src, QofBook *dest_book)
 {
   gnc_commodity * dest = g_object_new(GNC_TYPE_COMMODITY, NULL);
   qof_instance_init_data (&dest->inst, GNC_ID_COMMODITY, dest_book);
@@ -1204,7 +1204,7 @@
  *                   Namespace functions                    *
  ************************************************************/
 const char *
-gnc_commodity_namespace_get_name (gnc_commodity_namespace *ns)
+gnc_commodity_namespace_get_name (const gnc_commodity_namespace *ns)
 {
   if (ns == NULL)
     return NULL;
@@ -1261,7 +1261,7 @@
 }
 
 gnc_commodity *
-gnc_commodity_obtain_twin (gnc_commodity *from, QofBook *book)
+gnc_commodity_obtain_twin (const gnc_commodity *from, QofBook *book)
 {
   gnc_commodity *twin;
   const char * ucom;
@@ -1287,7 +1287,7 @@
  ********************************************************************/
 
 guint
-gnc_commodity_table_get_number_of_namespaces(gnc_commodity_table* tbl)
+gnc_commodity_table_get_number_of_namespaces(const gnc_commodity_table* tbl)
 {
     g_return_val_if_fail(tbl, 0);
     g_return_val_if_fail(tbl->ns_table, 0);
@@ -1312,7 +1312,7 @@
 }
 
 guint
-gnc_commodity_table_get_size(gnc_commodity_table* tbl)
+gnc_commodity_table_get_size(const gnc_commodity_table* tbl)
 {
     guint count = 0;
     g_return_val_if_fail(tbl, 0);

Modified: gnucash/branches/gda-dev2/src/engine/gnc-commodity.h
===================================================================
--- gnucash/branches/gda-dev2/src/engine/gnc-commodity.h	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/src/engine/gnc-commodity.h	2007-12-30 15:12:16 UTC (rev 16768)
@@ -149,7 +149,7 @@
  *  @param sources_list A list of strings containing the source names
  *  as they are known to F::Q.
  */
-void gnc_quote_source_set_fq_installed (GList *sources_list);
+void gnc_quote_source_set_fq_installed (const GList *sources_list);
 
 /** Return the number of entries for a given type of quote source.
  *
@@ -202,7 +202,7 @@
  *
  *  @return TRUE if the user's computer supports this quote source.
  */
-gboolean gnc_quote_source_get_supported (gnc_quote_source *source);
+gboolean gnc_quote_source_get_supported (const gnc_quote_source *source);
 
 /** Given a gnc_quote_source data structure, return the type of this
  *  particular quote source. (SINGLE, MULTI, UNKNOWN)
@@ -211,7 +211,7 @@
  *
  *  @return The type of this quote source.
  */
-QuoteSourceType gnc_quote_source_get_type (gnc_quote_source *source);
+QuoteSourceType gnc_quote_source_get_type (const gnc_quote_source *source);
 
 /** Given a gnc_quote_source data structure, return the index of this
  *  particular quote source within its type.
@@ -220,7 +220,7 @@
  *
  *  @return The index of this quote source in its type.
  */
-gint gnc_quote_source_get_index (gnc_quote_source *source);
+gint gnc_quote_source_get_index (const gnc_quote_source *source);
 
 /** Given a gnc_quote_source data structure, return the user friendly
  *  name of this quote source.  E.G. "Yahoo Australia" or "Australia
@@ -230,7 +230,7 @@
  *
  *  @return The user friendly name.
  */
-const char *gnc_quote_source_get_user_name (gnc_quote_source *source);
+const char *gnc_quote_source_get_user_name (const gnc_quote_source *source);
 
 /** Given a gnc_quote_source data structure, return the internal name
  *  of this quote source.  This is the name used by both gnucash and
@@ -240,7 +240,7 @@
  *
  *  @return The internal name.
  */
-const char *gnc_quote_source_get_internal_name (gnc_quote_source *source);
+const char *gnc_quote_source_get_internal_name (const gnc_quote_source *source);
 
 /** Given a gnc_quote_source data structure, return the internal name
  *  of this quote source.  This is the name used by both gnucash and
@@ -254,7 +254,7 @@
  *
  *  @return The internal name.
  */
-const char *gnc_quote_source_get_old_internal_name (gnc_quote_source *source);
+const char *gnc_quote_source_get_old_internal_name (const gnc_quote_source *source);
 /** @} */
 
 
@@ -309,10 +309,10 @@
 void  gnc_commodity_destroy(gnc_commodity * cm);
 
 /** Copy src into dest */
-void  gnc_commodity_copy(gnc_commodity * dest, gnc_commodity *src);
+void  gnc_commodity_copy(gnc_commodity * dest, const gnc_commodity *src);
 
 /** allocate and copy */
-gnc_commodity * gnc_commodity_clone(gnc_commodity *src, QofBook *dest_book);
+gnc_commodity * gnc_commodity_clone(const gnc_commodity *src, QofBook *dest_book);
 /** @} */
 
 
@@ -768,7 +768,7 @@
  *
  *  @return A pointer to the name of the namespace.  This string is
  *  owned by the engine and should not be freed by the caller. */
-const char * gnc_commodity_namespace_get_name (gnc_commodity_namespace *ns) ;
+const char * gnc_commodity_namespace_get_name (const gnc_commodity_namespace *ns) ;
 
 
 /** Return a list of all commodity data structures in the specified namespace.
@@ -785,7 +785,7 @@
  *
  *  @return The number of namespaces.  Zero if an invalid argument was
  *  supplied or there was an error. */
-guint gnc_commodity_table_get_number_of_namespaces(gnc_commodity_table* tbl);
+guint gnc_commodity_table_get_number_of_namespaces(const gnc_commodity_table* tbl);
 
 /** Test to see if the indicated namespace exits in the commodity table.
  *
@@ -862,7 +862,7 @@
  *
  *  @return The number of commodities in the table. 0 if there are no
  *  commodities, or the routine was passed a bad argument. */
-guint gnc_commodity_table_get_size(gnc_commodity_table* tbl);
+guint gnc_commodity_table_get_size(const gnc_commodity_table* tbl);
 
 /** Return a list of all commodities in the commodity table that are
  *  in the given namespace.
@@ -943,7 +943,7 @@
  *   the indicated book.  This routine is primarily useful for setting
  *   up clones of things across multiple books.
  */
-gnc_commodity * gnc_commodity_obtain_twin (gnc_commodity *from, QofBook *book);
+gnc_commodity * gnc_commodity_obtain_twin (const gnc_commodity *from, QofBook *book);
 
 /** You should probably not be using gnc_commodity_table_register()
  * It is an internal routine for registering the gncObject for the

Modified: gnucash/branches/gda-dev2/src/engine/test/test-book-merge.c
===================================================================
--- gnucash/branches/gda-dev2/src/engine/test/test-book-merge.c	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/src/engine/test/test-book-merge.c	2007-12-30 15:12:16 UTC (rev 16768)
@@ -24,7 +24,6 @@
 
 #include "config.h" 
 #include <glib.h>
-#include <unistd.h>
 
 #include "qof.h"
 #include "test-stuff.h"
@@ -505,7 +504,6 @@
 int
 main (int argc, char **argv)
 {
-  sleep(10);
 	qof_init();
 	myobjRegister();
 	test_merge();

Modified: gnucash/branches/gda-dev2/src/gnome-utils/gnc-dense-cal.c
===================================================================
--- gnucash/branches/gda-dev2/src/gnome-utils/gnc-dense-cal.c	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/src/gnome-utils/gnc-dense-cal.c	2007-12-30 15:12:16 UTC (rev 16768)
@@ -436,12 +436,18 @@
     dcal->week_starts_monday = 0;
     {
         gchar **parts;
-	/* Translators: This string should not have shown up in
-	   gnucash.pot as it is looked up in the "gtk20" translation
-	   domain. You can safely ignore this string and leave it
-	   untranslated. */
-        parts = g_strsplit(dgettext("gtk20", "calendar:week_start:0"),
-                           ":", 3);
+	const char *week_start_str;
+
+	/* Use this renaming macro to avoid extraction of the message
+	   string into the gnucash.pot file when calling xgettext. */
+#define dgettext_noextract dgettext
+	/* Translators: This string must not show up in gnucash.pot as
+	   it is looked up in the "gtk20" translation domain
+	   instead. */
+	week_start_str = dgettext_noextract("gtk20", "calendar:week_start:0");
+#undef dgettext_noextract
+
+        parts = g_strsplit(week_start_str, ":", 3);
         if (parts[0] != NULL
             && parts[1] != NULL
             && parts[2] != NULL)

Modified: gnucash/branches/gda-dev2/src/gnome-utils/gnc-tree-model-account.c
===================================================================
--- gnucash/branches/gda-dev2/src/gnome-utils/gnc-tree-model-account.c	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/src/gnome-utils/gnc-tree-model-account.c	2007-12-30 15:12:16 UTC (rev 16768)
@@ -549,6 +549,9 @@
   time_t t1, t2;
   gnc_numeric b3;  
 
+  if( negative )
+  	*negative = FALSE;
+
   priv = GNC_TREE_MODEL_ACCOUNT_GET_PRIVATE(model);
   if (acct == priv->root)
     return g_strdup("");

Modified: gnucash/branches/gda-dev2/src/import-export/ofx/gnc-ofx-import.c
===================================================================
--- gnucash/branches/gda-dev2/src/import-export/ofx/gnc-ofx-import.c	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/src/import-export/ofx/gnc-ofx-import.c	2007-12-30 15:12:16 UTC (rev 16768)
@@ -129,6 +129,10 @@
 	  gnc_utf8_strip_invalid(data.name);
 	if (data.memo_valid)
 	  gnc_utf8_strip_invalid(data.memo);
+	if (data.check_number_valid)
+	  gnc_utf8_strip_invalid(data.check_number);
+	if (data.reference_number_valid)
+	  gnc_utf8_strip_invalid(data.reference_number);
 
 	/********** Create the transaction and setup transaction data ************/
 	book = gnc_account_get_book(account);

Modified: gnucash/branches/gda-dev2/src/import-export/qif-import/qif-to-gnc.scm
===================================================================
--- gnucash/branches/gda-dev2/src/import-export/qif-import/qif-to-gnc.scm	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/src/import-export/qif-import/qif-to-gnc.scm	2007-12-30 15:12:16 UTC (rev 16768)
@@ -377,7 +377,8 @@
         (qif-number (qif-xtn:number qif-xtn))
         (qif-action (qif-xtn:action qif-xtn))
         (qif-security (qif-xtn:security-name qif-xtn))
-        (qif-memo (qif-split:memo (car (qif-xtn:splits qif-xtn))))
+        (qif-default-split (qif-xtn:default-split qif-xtn))
+        (qif-memo #f)
         (qif-from-acct (qif-xtn:from-acct qif-xtn))
         (qif-cleared (qif-xtn:cleared qif-xtn))
         (n- (lambda (n) (gnc-numeric-neg n)))
@@ -394,12 +395,20 @@
         (xaccTransSetDescription gnc-xtn qif-payee))
     (if qif-number
         (xaccTransSetNum gnc-xtn qif-number))
+
+    ;; Look for the transaction memo (QIF "M" line). When a default split
+    ;; exists, the memo can be found there. Otherwise, it will be in the
+    ;; first member of the splits list.
+    (if qif-default-split
+       (set! qif-memo (qif-split:memo qif-default-split))
+       (set! qif-memo (qif-split:memo (car (qif-xtn:splits qif-xtn)))))
     (if qif-memo
-	(begin
-	  (xaccSplitSetMemo gnc-near-split qif-memo)
 	  (if (or (not qif-payee)
-		  (equal? qif-payee ""))
-	      (xaccTransSetDescription gnc-xtn qif-memo))))
+	          (equal? qif-payee ""))
+	      (xaccTransSetDescription gnc-xtn qif-memo)
+	      ;; Use the memo for the transaction notes. Previously this went to
+	      ;; the debit/credit lines. See bug 495219 for more information.
+	      (xaccTransSetNotes gnc-xtn qif-memo)))
     
     (if (eq? qif-cleared 'cleared)        
         (xaccSplitSetReconcile gnc-near-split #\c))
@@ -428,7 +437,10 @@
                        (far-acct-type #f)
                        (far-acct #f)
                        (split-amt (qif-split:amount qif-split))
-                       (memo (qif-split:memo qif-split))
+                       ;; For split transactions, get this split's memo.
+                       (memo
+                         (if qif-default-split
+                             (qif-split:memo qif-split) #f))
                        (cat (qif-split:category qif-split)))
                    
                    (if (not split-amt) (set! split-amt (gnc-numeric-zero)))

Modified: gnucash/branches/gda-dev2/src/report/standard-reports/advanced-portfolio.scm
===================================================================
--- gnucash/branches/gda-dev2/src/report/standard-reports/advanced-portfolio.scm	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/src/report/standard-reports/advanced-portfolio.scm	2007-12-30 15:12:16 UTC (rev 16768)
@@ -197,7 +197,7 @@
   ;; sum up the contents of the b-list built by basis-builder below
   (define (sum-basis b-list)
     (if (not (eqv? b-list '()))
-	(gnc-numeric-add (gnc-numeric-mul (caar b-list) (cdar b-list) 100 GNC-RND-ROUND)
+	(gnc-numeric-add (gnc-numeric-mul (caar b-list) (cdar b-list) GNC-DENOM-AUTO GNC-RND-ROUND)
 			 (sum-basis (cdr b-list)) 100 GNC-RND-ROUND)
 	(gnc-numeric-zero)
 	)
@@ -207,7 +207,7 @@
   (define (units-basis b-list)
     (if (not (eqv? b-list '()))
 	(gnc-numeric-add (caar b-list) (units-basis (cdr b-list)) 
-			 100 (logior GNC-DENOM-REDUCE GNC-RND-NEVER))
+			 100 GNC-RND-ROUND)
 	(gnc-numeric-zero)
 	)
     )
@@ -216,8 +216,8 @@
   ;; I need to get a brain and use (map) for this.
   (define (apply-basis-ratio b-list units-ratio value-ratio)
     (if (not (eqv? b-list '()))
-	(cons (cons (gnc-numeric-mul units-ratio (caar b-list) 100000 GNC-RND-ROUND) 
-		    (gnc-numeric-mul value-ratio (cdar b-list) 100000 GNC-RND-ROUND)) 
+	(cons (cons (gnc-numeric-mul units-ratio (caar b-list) GNC-DENOM-AUTO GNC-RND-ROUND) 
+		    (gnc-numeric-mul value-ratio (cdar b-list) GNC-DENOM-AUTO GNC-RND-ROUND)) 
 	      (apply-basis-ratio (cdr b-list) units-ratio value-ratio))
 	'()
 	)    
@@ -241,22 +241,22 @@
 	((average-basis) 
 	 (if (not (eqv? b-list '()))
 	     (list (cons (gnc-numeric-add b-units
-					  (caar b-list) 10000 GNC-RND-ROUND) 
+					  (caar b-list) GNC-DENOM-AUTO GNC-RND-ROUND) 
 			 (gnc-numeric-div
 			  (gnc-numeric-add b-value
 					   (gnc-numeric-mul (caar b-list)
 							    (cdar b-list) 
-							    10000 GNC-RND-ROUND)
-					   10000 GNC-RND-ROUND)
+							    GNC-DENOM-AUTO GNC-RND-ROUND)
+					   GNC-DENOM-AUTO GNC-RND-ROUND)
 			  (gnc-numeric-add b-units
-					   (caar b-list) 10000 GNC-RND-ROUND)
-			  10000 GNC-RND-ROUND)))
+					   (caar b-list) GNC-DENOM-AUTO GNC-RND-ROUND)
+			  GNC-DENOM-AUTO GNC-RND-ROUND)))
 	     (append b-list 
 		     (list (cons b-units (gnc-numeric-div
-					  b-value b-units 10000 GNC-RND-ROUND))))))
+					  b-value b-units GNC-DENOM-AUTO GNC-RND-ROUND))))))
 	(else (append b-list 
 		      (list (cons b-units (gnc-numeric-div
-					   b-value b-units 10000 GNC-RND-ROUND)))))))
+					   b-value b-units GNC-DENOM-AUTO GNC-RND-ROUND)))))))
 
      ;; we have value and negative units, remove units from basis
      ((and (not (gnc-numeric-zero-p b-value))
@@ -268,11 +268,11 @@
 			     (gnc-numeric-abs b-units) (caar b-list))))
 		 (basis-builder (cdr b-list) (gnc-numeric-add
 					      b-units 
-					      (caar b-list) 10000 GNC-RND-ROUND) 
+					      (caar b-list) GNC-DENOM-AUTO GNC-RND-ROUND) 
 				b-value b-method)
 		 (append (list (cons (gnc-numeric-add
 				      b-units 
-				      (caar b-list) 10000 GNC-RND-ROUND) 
+				      (caar b-list) GNC-DENOM-AUTO GNC-RND-ROUND) 
 				     (cdar b-list))) (cdr b-list))))
 	    ((filo-basis) 
 	     (if (not (= -1 (gnc-numeric-compare
@@ -281,16 +281,16 @@
 				(gnc-numeric-add
 				 b-units 
 				 (caar (reverse b-list)) 
-				 10000 GNC-RND-ROUND) 
+				 GNC-DENOM-AUTO GNC-RND-ROUND) 
 				b-value b-method)
 		 (append (cdr (reverse b-list)) 
 			 (list (cons (gnc-numeric-add
 				      b-units 
-				      (caar (reverse b-list)) 10000 GNC-RND-ROUND) 
+				      (caar (reverse b-list)) GNC-DENOM-AUTO GNC-RND-ROUND) 
 				     (cdar (reverse b-list)))))))
 	    ((average-basis) 
 	     (list (cons (gnc-numeric-add
-			  (caar b-list) b-units 10000 GNC-RND-ROUND) 
+			  (caar b-list) b-units GNC-DENOM-AUTO GNC-RND-ROUND) 
 			 (cdar b-list)))))
 	  '()
 	  ))
@@ -299,11 +299,11 @@
      ((and (gnc-numeric-zero-p b-value)
 	   (not (gnc-numeric-zero-p b-units)))
 	(let* ((current-units (units-basis b-list))
-	       (units-ratio (gnc-numeric-div (gnc-numeric-add b-units current-units 100000 GNC-RND-ROUND) 
-					     current-units 10000 GNC-RND-ROUND))
-	       (value-ratio (gnc-numeric-div (gnc:make-gnc-numeric 1 1) units-ratio 100000 GNC-RND-ROUND)))
+	       (units-ratio (gnc-numeric-div (gnc-numeric-add b-units current-units GNC-DENOM-AUTO GNC-RND-ROUND) 
+					     current-units GNC-DENOM-AUTO GNC-RND-ROUND))
+	       (value-ratio (gnc-numeric-div (gnc:make-gnc-numeric 1 1) units-ratio GNC-DENOM-AUTO GNC-RND-ROUND)))
 	  
-	  (gnc:debug "blist is " b-list " units ratio is " units-ratio)
+	  (gnc:debug "blist is " b-list " current units is " current-units " units ratio is " units-ratio)
 	  (apply-basis-ratio b-list units-ratio value-ratio) 
 	  ))
 
@@ -313,8 +313,8 @@
      ((and (gnc-numeric-zero-p b-units)
 	   (not (gnc-numeric-zero-p b-value)))
       (let* ((current-value (sum-basis b-list))
-	     (value-ratio (gnc-numeric-div (gnc-numeric-add b-value current-value 100000 GNC-RND-ROUND) 
-					   current-value 100000 GNC-RND-ROUND)))
+	     (value-ratio (gnc-numeric-div (gnc-numeric-add b-value current-value GNC-DENOM-AUTO GNC-RND-ROUND) 
+					   current-value GNC-DENOM-AUTO GNC-RND-ROUND)))
 	  
 	(gnc:debug "this is a spinoff")
 	(gnc:debug "blist is " b-list " value ratio is " value-ratio)
@@ -545,13 +545,13 @@
 				  (gnc:make-gnc-monetary commod-currency
 							 (gnc-numeric-div txn-value
 									  (gnc-numeric-abs txn-units)
-									  100 (logior GNC-DENOM-REDUCE GNC-RND-NEVER)))
+									  100 GNC-RND-ROUND))
 				  (gnc:make-gnc-monetary commod-currency (gnc-numeric-zero))))
 		  
 		  (set! value (if price (gnc:make-gnc-monetary commod-currency 
 						     (gnc-numeric-mul units
 								      (gnc:gnc-monetary-amount price)
-										100 (logior GNC-DENOM-REDUCE GNC-RND-NEVER)))
+										100 GNC-RND-ROUND))
 				  (gnc:make-gnc-monetary commod-currency (gnc-numeric-zero))))
 		  (set! warn-price-dirty #t)
 		  )  
@@ -582,10 +582,10 @@
 		  (ugain (gnc:make-gnc-monetary currency 
 						(gnc-numeric-sub (gnc:gnc-monetary-amount (exchange-fn value currency))
 								 (sum-basis basis-list) 
-								 100 (logior GNC-DENOM-REDUCE GNC-RND-NEVER))))
+								 100 GNC-RND-ROUND)))
 		  (bothgain (gnc:make-gnc-monetary currency  (gnc-numeric-add (gnc:gnc-monetary-amount gain)
 									      (gnc:gnc-monetary-amount ugain)
-									      100 (logior GNC-DENOM-REDUCE GNC-RND-NEVER))))
+									      100 GNC-RND-ROUND)))
 
 		  (activecols (list (gnc:html-account-anchor current)))
 		  )
@@ -784,7 +784,7 @@
 	  (set! sum-total-ugain (gnc:sum-collector-commodity total-ugain currency exchange-fn))
 	  (set! sum-total-both-gains (gnc:make-gnc-monetary currency (gnc-numeric-add (gnc:gnc-monetary-amount sum-total-gain)
 										      (gnc:gnc-monetary-amount sum-total-ugain)
-										      100 (logior GNC-DENOM-REDUCE GNC-RND-NEVER))))
+										      100 GNC-RND-ROUND)))
 	  (set! sum-total-brokerage (gnc:sum-collector-commodity total-brokerage currency exchange-fn))
 
           (gnc:html-table-append-row/markup!

Modified: gnucash/branches/gda-dev2/src/report/standard-reports/cash-flow.scm
===================================================================
--- gnucash/branches/gda-dev2/src/report/standard-reports/cash-flow.scm	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/src/report/standard-reports/cash-flow.scm	2007-12-30 15:12:16 UTC (rev 16768)
@@ -192,9 +192,11 @@
 
 
     (gnc:html-document-set-title! 
-     doc (sprintf #f (_ "%s - %s to %s for")
-		  (get-option gnc:pagename-general gnc:optname-reportname)
-                  (gnc-print-date from-date-tp) (gnc-print-date to-date-tp)))
+     doc (string-append
+	  (get-option gnc:pagename-general gnc:optname-reportname)
+	  " - "
+	  (sprintf #f (_ "%s to %s")
+		   (gnc-print-date from-date-tp) (gnc-print-date to-date-tp))))
 
 
     ;; add subaccounts if requested

Modified: gnucash/branches/gda-dev2/src/valgrind-gnucash.supp
===================================================================
--- gnucash/branches/gda-dev2/src/valgrind-gnucash.supp	2007-12-30 10:57:38 UTC (rev 16767)
+++ gnucash/branches/gda-dev2/src/valgrind-gnucash.supp	2007-12-30 15:12:16 UTC (rev 16768)
@@ -37,15 +37,15 @@
 #     if Free: name of free-ing fn)
 
 {
-   libguile.so.12(Cond)
+   libguile.so(Cond)
    Memcheck:Cond
-   obj:/usr/lib/libguile.so.12.3.0
+   obj:*libguile.so.*
 }
 
 {
-   libguile.so.12(Value4)
+   libguile.so(Value4)
    Memcheck:Value4
-   obj:/usr/lib/libguile.so.12.3.0
+   obj:*libguile.so*
 }
 
 {
@@ -57,27 +57,36 @@
 }
 
 {
-   <insert a suppression name here>
+   write(buf) Param
    Memcheck:Param
    write(buf)
-   fun:__write_nocancel
-   obj:/usr/X11R6/lib/libX11.so.6.2
+   obj:/lib/libpthread-2.5.so
    fun:_X11TransWrite
-   obj:/usr/X11R6/lib/libX11.so.6.2
 }
 
 {
    <insert a suppression name here>
    Memcheck:Param
    writev(vector[...])
+   fun:do_writev
    fun:writev
-   obj:/usr/lib/libORBit-2.so.0.0.0
+   obj:*libORBit-2.so*
    fun:link_connection_writev
    fun:giop_send_buffer_write
 }
 
 {
    <insert a suppression name here>
+   Memcheck:Param
+   writev(vector[...])
+   fun:do_writev
+   obj:*libORBit-2.so*
+   fun:link_connection_writev
+   fun:giop_send_buffer_write
+}
+
+{
+   <insert a suppression name here>
    core:PThread
    fun:pthread_mutex_lock
    fun:_IO_flockfile



More information about the gnucash-changes mailing list