r15212 - gnucash/branches/gda-dev/src/backend/gda - Use QofAccessFunc/QofSetterFunc function signatures instead of creating

Phil Longstaff plongstaff at cvs.gnucash.org
Wed Dec 13 21:30:22 EST 2006


Author: plongstaff
Date: 2006-12-13 21:30:19 -0500 (Wed, 13 Dec 2006)
New Revision: 15212
Trac: http://svn.gnucash.org/trac/changeset/15212

Modified:
   gnucash/branches/gda-dev/src/backend/gda/
   gnucash/branches/gda-dev/src/backend/gda/gnc-account-gda.c
   gnucash/branches/gda-dev/src/backend/gda/gnc-backend-gda.c
   gnucash/branches/gda-dev/src/backend/gda/gnc-backend-gda.h
   gnucash/branches/gda-dev/src/backend/gda/gnc-budget-gda.c
   gnucash/branches/gda-dev/src/backend/gda/gnc-commodity-gda.c
   gnucash/branches/gda-dev/src/backend/gda/gnc-lots-gda.c
   gnucash/branches/gda-dev/src/backend/gda/gnc-price-gda.c
   gnucash/branches/gda-dev/src/backend/gda/gnc-schedxaction-gda.c
   gnucash/branches/gda-dev/src/backend/gda/gnc-slots-gda.c
   gnucash/branches/gda-dev/src/backend/gda/gnc-transaction-gda.c
Log:
Use QofAccessFunc/QofSetterFunc function signatures instead of creating
new ones



Property changes on: gnucash/branches/gda-dev/src/backend/gda
___________________________________________________________________
Name: svn:ignore
   + Makefile.in
Makefile
.libs
.deps


Modified: gnucash/branches/gda-dev/src/backend/gda/gnc-account-gda.c
===================================================================
--- gnucash/branches/gda-dev/src/backend/gda/gnc-account-gda.c	2006-12-12 11:41:59 UTC (rev 15211)
+++ gnucash/branches/gda-dev/src/backend/gda/gnc-account-gda.c	2006-12-14 02:30:19 UTC (rev 15212)
@@ -45,10 +45,10 @@
 
 #define TABLE_NAME "accounts"
 
-static gpointer get_commodity( gpointer pObject );
-static void set_commodity( gpointer pObject, const gpointer pValue );
-static gpointer get_parent( gpointer pObject );
-static void set_parent( gpointer pObject, const gpointer pValue );
+static gpointer get_commodity( gpointer pObject, const QofParam* );
+static void set_commodity( gpointer pObject, gpointer pValue );
+static gpointer get_parent( gpointer pObject, const QofParam* );
+static void set_parent( gpointer pObject, gpointer pValue );
 
 #define ACCOUNT_MAX_NAME_LEN 50
 #define ACCOUNT_MAX_TYPE_LEN 50
@@ -58,8 +58,8 @@
 static col_cvt_t col_table[] =
 {
 	{ "guid",			CT_GUID,	0, COL_NNUL|COL_PKEY,	NULL,
-			(GNC_GDA_FN_GETTER)qof_entity_get_guid,
-			(GNC_GDA_FN_SETTER)xaccAccountSetGUID },
+			(QofAccessFunc)qof_entity_get_guid,
+			(QofSetterFunc)xaccAccountSetGUID },
 	{ "name",			CT_STRING,	ACCOUNT_MAX_NAME_LEN, COL_NNUL,	ACCOUNT_NAME_ },
 	{ "account_type",	CT_STRING,	ACCOUNT_MAX_TYPE_LEN, COL_NNUL,	ACCOUNT_TYPE_ },
 	{ "commodity_guid",	CT_GUID,	0, COL_NNUL,	NULL,
@@ -72,7 +72,7 @@
 
 /* ================================================================= */
 static gpointer
-get_commodity( gpointer pObject )
+get_commodity( gpointer pObject, const QofParam* param )
 {
 	const Account* pAccount = GNC_ACCOUNT(pObject);
 
@@ -81,7 +81,7 @@
 }
 
 static void 
-set_commodity( gpointer pObject, const gpointer pValue )
+set_commodity( gpointer pObject, gpointer pValue )
 {
 	Account* pAccount = GNC_ACCOUNT(pObject);
 	QofBook* pBook = qof_instance_get_book( QOF_INSTANCE(pAccount) );
@@ -93,7 +93,7 @@
 }
 
 static gpointer
-get_parent( gpointer pObject )
+get_parent( gpointer pObject, const QofParam* param )
 {
 	const Account* pAccount = GNC_ACCOUNT(pObject);
 	const Account* pParent = xaccAccountGetParentAccount( pAccount );
@@ -109,7 +109,7 @@
 }
 
 static void 
-set_parent( gpointer pObject, const gpointer pValue )
+set_parent( gpointer pObject, gpointer pValue )
 {
 	Account* pAccount = GNC_ACCOUNT(pObject);
 	QofBook* pBook = qof_instance_get_book( QOF_INSTANCE(pAccount) );

Modified: gnucash/branches/gda-dev/src/backend/gda/gnc-backend-gda.c
===================================================================
--- gnucash/branches/gda-dev/src/backend/gda/gnc-backend-gda.c	2006-12-12 11:41:59 UTC (rev 15211)
+++ gnucash/branches/gda-dev/src/backend/gda/gnc-backend-gda.c	2006-12-14 02:30:19 UTC (rev 15212)
@@ -142,6 +142,21 @@
 	return cond;
 }
 /* ----------------------------------------------------------------- */
+static QofAccessFunc
+get_getter( QofIdTypeConst obj_name, const col_cvt_t* table_row )
+{
+	QofAccessFunc getter;
+
+	if( table_row->param_name != NULL ) {
+		getter = qof_class_get_parameter_getter( obj_name,
+												table_row->param_name );
+	} else {
+		getter = table_row->getter;
+	}
+
+	return getter;
+}
+
 static void
 load_string( GdaDataModel* pModel, gint row,
 			QofSetterFunc setter, gpointer pObject,
@@ -167,13 +182,8 @@
 	gchar* s;
 
 	memset( value, 0, sizeof( GValue ) );
-	if( table_row->param_name != NULL ) {
-		getter = qof_class_get_parameter_getter( obj_name,
-												table_row->param_name );
-		s = (gchar*)(*getter)( pObject, NULL );
-	} else {
-		s = (gchar*)(*table_row->getter)( pObject );
-	}
+	getter = get_getter( obj_name, table_row );
+	s = (gchar*)(*getter)( pObject, NULL );
 	if( s ) {
 		g_value_init( value, G_TYPE_STRING );
 		g_value_set_string( value, s );
@@ -244,13 +254,8 @@
 
 	memset( value, 0, sizeof( GValue ) );
 
-	if( table_row->param_name != NULL ) {
-		getter = qof_class_get_parameter_getter( obj_name,
-												table_row->param_name );
-		int_value = (gint)(*getter)( pObject, NULL );
-	} else {
-		int_value = (gint)(*table_row->getter)( pObject );
-	}
+	getter = get_getter( obj_name, table_row );
+	int_value = (gint)(*getter)( pObject, NULL );
 	g_value_init( value, G_TYPE_INT );
 	g_value_set_int( value, int_value );
 }
@@ -315,9 +320,11 @@
 {
 	gint64* pInt64;
 	gint64 i64_value;
+	QofAccessFunc getter;
 
 	memset( value, 0, sizeof( GValue ) );
-	pInt64 = (*table_row->getter)( pObject );
+	getter = get_getter( obj_name, table_row );
+	pInt64 = (*getter)( pObject, NULL );
 	if( pInt64 != NULL ) {
 		gchar* s;
 
@@ -385,12 +392,14 @@
 get_gvalue_double( GncGdaBackend* be, QofIdTypeConst obj_name, gpointer pObject,
 				const col_cvt_t* table_row, GValue* value )
 {
+	QofAccessFunc getter;
 	gdouble* pDouble;
 	gdouble d_value;
 
 	memset( value, 0, sizeof( GValue ) );
 
-	pDouble = (*table_row->getter)( pObject );
+	getter = get_getter( obj_name, table_row );
+	pDouble = (*getter)( pObject, NULL );
 	if( pDouble != NULL ) {
 		d_value = *pDouble;
 		g_value_init( value, G_TYPE_DOUBLE );
@@ -458,16 +467,14 @@
 get_gvalue_guid( GncGdaBackend* be, QofIdTypeConst obj_name, gpointer pObject,
 				const col_cvt_t* table_row, GValue* value )
 {
+	QofAccessFunc getter;
 	const GUID* guid;
 	gchar guid_buf[GUID_ENCODING_LENGTH+1];
 
 	memset( value, 0, sizeof( GValue ) );
 
-	if( table_row->getter != NULL ) {
-		guid = (*table_row->getter)( pObject );
-	} else {
-		guid = NULL;
-	}
+	getter = get_getter( obj_name, table_row );
+	guid = (*getter)( pObject, NULL );
 	if( guid != NULL ) {
 		(void)guid_to_string_buff( guid, guid_buf );
 		g_value_init( value, G_TYPE_STRING );
@@ -534,11 +541,13 @@
 get_gvalue_timespec( GncGdaBackend* be, QofIdTypeConst obj_name,
 				gpointer pObject, const col_cvt_t* table_row, GValue* value )
 {
+	QofAccessFunc getter;
 	Timespec* pTimespec;
 
 	memset( value, 0, sizeof( GValue ) );
 
-	pTimespec = (Timespec*)(*table_row->getter)( pObject );
+	getter = get_getter( obj_name, table_row );
+	pTimespec = (Timespec*)(*getter)( pObject, NULL );
 	if( pTimespec != NULL ) {
 		GDate* date;
 		gchar* s;
@@ -603,7 +612,9 @@
 		(*setter)( pObject, NULL );
 	} else {
 		date = (GDate*)g_value_get_boxed( val );
-		(*setter)( pObject, date );
+		if( date != NULL ) {
+			(*setter)( pObject, date );
+		}
 	}
 }
 
@@ -616,13 +627,8 @@
 
 	memset( value, 0, sizeof( GValue ) );
 
-	if( table_row->param_name != NULL ) {
-		getter = qof_class_get_parameter_getter( obj_name,
-												table_row->param_name );
-		date = (GDate*)(*getter)( pObject, NULL );
-	} else {
-		date = (GDate*)(*table_row->getter)( pObject );
-	}
+	getter = get_getter( obj_name, table_row );
+	date = (GDate*)(*getter)( pObject, NULL );
 	if( date != NULL ) {
 		g_value_init( value, G_TYPE_DATE );
 		g_value_set_boxed( value, date );
@@ -694,11 +700,13 @@
 get_gvalue_numeric( GncGdaBackend* be, QofIdTypeConst obj_name, gpointer pObject,
 				const col_cvt_t* table_row, GValue* value )
 {
+	QofAccessFunc getter;
 	gnc_numeric* n;
 
 	memset( value, 0, sizeof( GValue ) );
 
-	n = (gnc_numeric*)(*table_row->getter)( pObject );
+	getter = get_getter( obj_name, table_row );
+	n = (gnc_numeric*)(*getter)( pObject, NULL );
 	if( n != NULL ) {
 		g_value_init( value, gnc_numeric_get_type() );
 		g_value_set_boxed( value, n );
@@ -848,10 +856,10 @@
 	return pHandler;
 }
 
-static void retrieve_guid( gpointer pObject, const gpointer pValue );
+static void retrieve_guid( gpointer pObject, gpointer pValue );
 
 static void 
-retrieve_guid( gpointer pObject, const gpointer pValue )
+retrieve_guid( gpointer pObject, gpointer pValue )
 {
 	GUID** ppGuid = (GUID**)pObject;
 	GUID* guid = (GUID*)pValue;
@@ -1204,40 +1212,41 @@
 	GdaServerOperation *op;
 	GdaServerProvider *server;
 	
-	g_return_val_if_fail (GDA_IS_CONNECTION (cnn), FALSE);
-	g_return_val_if_fail (gda_connection_is_opened (cnn), FALSE);
+	g_return_val_if_fail( GDA_IS_CONNECTION(cnn), FALSE );
+	g_return_val_if_fail( gda_connection_is_opened(cnn), FALSE );
 	
-	server = gda_connection_get_provider_obj(cnn);
+	server = gda_connection_get_provider_obj( cnn );
 	
-	op = gda_server_provider_create_operation (server, cnn, 
-						   GDA_SERVER_OPERATION_CREATE_TABLE, NULL, error);
-	if (GDA_IS_SERVER_OPERATION (op)) {
+	op = gda_server_provider_create_operation( server, cnn, 
+						   GDA_SERVER_OPERATION_CREATE_TABLE, NULL, error );
+	if( GDA_IS_SERVER_OPERATION(op) ) {
 		gint col;
 		GType type;
 		xmlDocPtr parameters;
 		xmlNodePtr root;
 		xmlNodePtr table, op_data, array_data, array_row, array_value;
 		
-		if (table_name == NULL) {
-			g_message("Table name is NULL!");      
-			g_set_error (error, GDA_GENERAL_ERROR, GDA_GENERAL_OBJECT_NAME_ERROR, 
-				    "Couldn't create table with a NULL string");
+		if( table_name == NULL ) {
+			g_message( "Table name is NULL!" );      
+			g_set_error( error,
+					GDA_GENERAL_ERROR, GDA_GENERAL_OBJECT_NAME_ERROR, 
+				    "Couldn't create table with a NULL string" );
 			return FALSE;    
 		}
 		
 	
 		/* Initation of the xmlDoc */
-		parameters = xmlNewDoc ("1.0");
+		parameters = xmlNewDoc( "1.0" );
 		
-		root = xmlNewDocNode (parameters, NULL, "serv_op_data", NULL);
-		xmlDocSetRootElement (parameters, root);
-		table = xmlNewChild (root, NULL, "op_data", table_name);
-		xmlSetProp (table, "path", "/TABLE_DEF_P/TABLE_NAME");
+		root = xmlNewDocNode( parameters, NULL, "serv_op_data", NULL );
+		xmlDocSetRootElement( parameters, root );
+		table = xmlNewChild( root, NULL, "op_data", table_name );
+		xmlSetProp( table, "path", "/TABLE_DEF_P/TABLE_NAME" );
 
-		op_data = xmlNewChild (root, NULL, "op_data", NULL);
-		xmlSetProp (op_data, "path", "/FIELDS_A");
-		array_data = xmlNewChild (op_data, NULL, "gda_array_data", NULL);
-			
+		op_data = xmlNewChild( root, NULL, "op_data", NULL );
+		xmlSetProp( op_data, "path", "/FIELDS_A" );
+		array_data = xmlNewChild( op_data, NULL, "gda_array_data", NULL );
+
 		type = 0;
 		
 		for( col = 0; col_table[col].col_name != NULL; col++ ) {
@@ -1253,31 +1262,30 @@
 			pHandler->create_col_fn( server, cnn, array_data, &col_table[col] );
 		}
 		
-		if (!gda_server_operation_load_data_from_xml (op, root, error)) {
+		if( !gda_server_operation_load_data_from_xml(op, root, error ) ) {
 			/* error */
-			g_set_error (error, GDA_GENERAL_ERROR, GDA_GENERAL_OPERATION_ERROR, 
-				     "The XML operation doesn't exist or could't be loaded");
-			g_object_unref (op);
-			xmlFreeDoc(parameters);
+			g_set_error( error, GDA_GENERAL_ERROR, GDA_GENERAL_OPERATION_ERROR, 
+				     "The XML operation doesn't exist or could't be loaded" );
+			g_object_unref( op );
+			xmlFreeDoc( parameters );
 			return FALSE;
-		}
-		else {
-			if (gda_server_provider_perform_operation (server, cnn, op, error)) {
+		} else {
+			if( !gda_server_provider_perform_operation( server, cnn, op, error ) ) {
 				/* error */
-				g_set_error(error, GDA_GENERAL_ERROR, GDA_GENERAL_OPERATION_ERROR, 
-					    "The Server couldn't perform the CREATE TABLE operation!");
-				g_object_unref (op);
-				xmlFreeDoc(parameters);
+				g_set_error( error,
+					GDA_GENERAL_ERROR, GDA_GENERAL_OPERATION_ERROR, 
+					"The Server couldn't perform the CREATE TABLE operation!" );
+				g_object_unref( op );
+				xmlFreeDoc( parameters );
 				return FALSE;
 			}
 		}
-		
-		g_object_unref (op);
-		xmlFreeDoc(parameters);
-	}
-	else {
-		g_set_error(error, GDA_GENERAL_ERROR, GDA_GENERAL_OBJECT_NAME_ERROR, 
-			    "The Server doesn't support the CREATE TABLE operation!");
+
+		g_object_unref( op );
+		xmlFreeDoc( parameters );
+	} else {
+		g_set_error( error, GDA_GENERAL_ERROR, GDA_GENERAL_OBJECT_NAME_ERROR, 
+			    "The Server doesn't support the CREATE TABLE operation!" );
 		return FALSE;
 	}
 	return TRUE;
@@ -1545,6 +1553,9 @@
 				inst->entity.e_type );
 		return;
 	}
+
+	inst->dirty = FALSE;
+	qof_book_mark_saved( be->primary_book );
 }
 /* ---------------------------------------------------------------------- */
 
@@ -1789,6 +1800,8 @@
 	be->loading = TRUE;
 	be->in_query = TRUE;
 
+	qof_event_suspend();
+
 	// Try various objects first
 	be_data.ok = FALSE;
 	be_data.be = be;
@@ -1798,6 +1811,7 @@
 	qof_object_foreach_backend( GNC_GDA_BACKEND, run_query_cb, &be_data );
 	be->loading = FALSE;
 	be->in_query = FALSE;
+	qof_event_resume();
 	if( be_data.ok ) {
 		return;
 	}

Modified: gnucash/branches/gda-dev/src/backend/gda/gnc-backend-gda.h
===================================================================
--- gnucash/branches/gda-dev/src/backend/gda/gnc-backend-gda.h	2006-12-12 11:41:59 UTC (rev 15211)
+++ gnucash/branches/gda-dev/src/backend/gda/gnc-backend-gda.h	2006-12-14 02:30:19 UTC (rev 15212)
@@ -78,9 +78,6 @@
 //QofBackend * libgncmod_backend_gda_LTX_gnc_backend_new(void);
 
 // Type for conversion of db row to object.
-typedef gpointer (*GNC_GDA_FN_GETTER)( gpointer pObject );
-typedef void (*GNC_GDA_FN_SETTER)( gpointer pObject, gpointer pValue );
-
 typedef enum {
 	CT_STRING,
 	CT_GUID,
@@ -103,8 +100,8 @@
 #define COL_AUTOINC	0x08
 	gint flags;
 	const char* param_name;		// If non null, use qof getter/setter
-	GNC_GDA_FN_GETTER getter;
-	GNC_GDA_FN_SETTER setter;
+	QofAccessFunc getter;
+	QofSetterFunc setter;
 } col_cvt_t;
 
 typedef enum {

Modified: gnucash/branches/gda-dev/src/backend/gda/gnc-budget-gda.c
===================================================================
--- gnucash/branches/gda-dev/src/backend/gda/gnc-budget-gda.c	2006-12-12 11:41:59 UTC (rev 15211)
+++ gnucash/branches/gda-dev/src/backend/gda/gnc-budget-gda.c	2006-12-14 02:30:19 UTC (rev 15212)
@@ -45,12 +45,12 @@
 
 static QofLogModule log_module = GNC_MOD_BACKEND;
 
-static gpointer get_recurrence_mult( gpointer pObject );
-static void set_recurrence_mult( gpointer pObject, const gpointer pValue );
-static gpointer get_recurrence_period_type( gpointer pObject );
-static void set_recurrence_period_type( gpointer pObject, const gpointer pValue );
-static gpointer get_recurrence_period_start( gpointer pObject );
-static void set_recurrence_period_start( gpointer pObject, const gpointer pValue );
+static gpointer get_recurrence_mult( gpointer pObject, const QofParam* );
+static void set_recurrence_mult( gpointer pObject, gpointer pValue );
+static gpointer get_recurrence_period_type( gpointer pObject, const QofParam* );
+static void set_recurrence_period_type( gpointer pObject, gpointer pValue );
+static gpointer get_recurrence_period_start( gpointer pObject, const QofParam* );
+static void set_recurrence_period_start( gpointer pObject, gpointer pValue );
 
 #define BUDGET_MAX_NAME_LEN 50
 #define BUDGET_MAX_DESCRIPTION_LEN 500
@@ -59,8 +59,8 @@
 static col_cvt_t col_table[] =
 {
 	{ "guid",			CT_GUID,	0, COL_NNUL|COL_PKEY,	NULL,
-			(GNC_GDA_FN_GETTER)qof_entity_get_guid,
-			(GNC_GDA_FN_SETTER)qof_entity_set_guid },
+			(QofAccessFunc)qof_entity_get_guid,
+			(QofSetterFunc)qof_entity_set_guid },
 	{ "name",			CT_STRING,	BUDGET_MAX_NAME_LEN, COL_NNUL,	"name" },
 	{ "description",	CT_STRING,	BUDGET_MAX_DESCRIPTION_LEN, 0,	"description" },
 	{ "num_periods",	CT_INT,		0, COL_NNUL, "num_periods" },
@@ -75,7 +75,7 @@
 
 /* ================================================================= */
 static gpointer
-get_recurrence_mult( gpointer pObject )
+get_recurrence_mult( gpointer pObject, const QofParam* param )
 {
 	GncBudget* budget = GNC_BUDGET(pObject);
 	const Recurrence* r = gnc_budget_get_recurrence( budget );
@@ -95,7 +95,7 @@
 }
 
 static gpointer
-get_recurrence_period_type( gpointer pObject )
+get_recurrence_period_type( gpointer pObject, const QofParam* param )
 {
 	GncBudget* budget = GNC_BUDGET(pObject);
 	const Recurrence* r = gnc_budget_get_recurrence( budget );
@@ -114,7 +114,7 @@
 }
 
 static gpointer
-get_recurrence_period_start( gpointer pObject )
+get_recurrence_period_start( gpointer pObject, const QofParam* param )
 {
 	GncBudget* budget = GNC_BUDGET(pObject);
 	const Recurrence* r = gnc_budget_get_recurrence( budget );

Modified: gnucash/branches/gda-dev/src/backend/gda/gnc-commodity-gda.c
===================================================================
--- gnucash/branches/gda-dev/src/backend/gda/gnc-commodity-gda.c	2006-12-12 11:41:59 UTC (rev 15211)
+++ gnucash/branches/gda-dev/src/backend/gda/gnc-commodity-gda.c	2006-12-14 02:30:19 UTC (rev 15212)
@@ -43,8 +43,8 @@
 
 static QofLogModule log_module = GNC_MOD_BACKEND;
 
-static gpointer get_quote_source_name( gpointer pObject );
-static void set_quote_source_name( gpointer pObject, const gpointer pValue );
+static gpointer get_quote_source_name( gpointer pObject, const QofParam* );
+static void set_quote_source_name( gpointer pObject, gpointer pValue );
 
 #define COMMODITIES_TABLE "commodities"
 
@@ -57,38 +57,38 @@
 
 static col_cvt_t col_table[] = {
 	{ "guid",			CT_GUID,	0, COL_NNUL|COL_PKEY,	NULL,
-			(GNC_GDA_FN_GETTER)qof_entity_get_guid,
-			(GNC_GDA_FN_SETTER)qof_entity_set_guid },
+			(QofAccessFunc)qof_entity_get_guid,
+			(QofSetterFunc)qof_entity_set_guid },
 	{ "namespace",		CT_STRING,	COMMODITY_MAX_NAMESPACE_LEN, COL_NNUL,	NULL,
-			(GNC_GDA_FN_GETTER)gnc_commodity_get_namespace,
-			(GNC_GDA_FN_SETTER)gnc_commodity_set_namespace },
+			(QofAccessFunc)gnc_commodity_get_namespace,
+			(QofSetterFunc)gnc_commodity_set_namespace },
 	{ "mnemonic",		CT_STRING,	COMMODITY_MAX_MNEMONIC_LEN, COL_NNUL,	NULL,
-			(GNC_GDA_FN_GETTER)gnc_commodity_get_mnemonic,
-			(GNC_GDA_FN_SETTER)gnc_commodity_set_mnemonic },
+			(QofAccessFunc)gnc_commodity_get_mnemonic,
+			(QofSetterFunc)gnc_commodity_set_mnemonic },
 	{ "fullname",		CT_STRING,	COMMODITY_MAX_FULLNAME_LEN, COL_NNUL,	NULL,
-			(GNC_GDA_FN_GETTER)gnc_commodity_get_fullname,
-			(GNC_GDA_FN_SETTER)gnc_commodity_set_fullname },
+			(QofAccessFunc)gnc_commodity_get_fullname,
+			(QofSetterFunc)gnc_commodity_set_fullname },
 	{ "cusip",			CT_STRING,	COMMODITY_MAX_CUSIP_LEN, COL_NNUL,	NULL,
-			(GNC_GDA_FN_GETTER)gnc_commodity_get_cusip,
-			(GNC_GDA_FN_SETTER)gnc_commodity_set_cusip },
+			(QofAccessFunc)gnc_commodity_get_cusip,
+			(QofSetterFunc)gnc_commodity_set_cusip },
 	{ "fraction",		CT_INT,		0, COL_NNUL,	NULL,
-			(GNC_GDA_FN_GETTER)gnc_commodity_get_fraction,
-			(GNC_GDA_FN_SETTER)gnc_commodity_set_fraction },
+			(QofAccessFunc)gnc_commodity_get_fraction,
+			(QofSetterFunc)gnc_commodity_set_fraction },
 	{ "quote_flag",		CT_INT,		0, COL_NNUL,	NULL,
-			(GNC_GDA_FN_GETTER)gnc_commodity_get_quote_flag,
-			(GNC_GDA_FN_SETTER)gnc_commodity_set_quote_flag },
+			(QofAccessFunc)gnc_commodity_get_quote_flag,
+			(QofSetterFunc)gnc_commodity_set_quote_flag },
 	{ "quote_source",	CT_STRING,	COMMODITY_MAX_QUOTESOURCE_LEN, 0,	NULL,
 			get_quote_source_name, set_quote_source_name },
 	{ "quote_tz",		CT_STRING,	COMMODITY_MAX_QUOTE_TZ_LEN, 0,	NULL,
-			(GNC_GDA_FN_GETTER)gnc_commodity_get_quote_tz,
-			(GNC_GDA_FN_SETTER)gnc_commodity_set_quote_tz },
+			(QofAccessFunc)gnc_commodity_get_quote_tz,
+			(QofSetterFunc)gnc_commodity_set_quote_tz },
 	{ NULL }
 };
 
 /* ================================================================= */
 
 static gpointer
-get_quote_source_name( gpointer pObject )
+get_quote_source_name( gpointer pObject, const QofParam* param )
 {
 	const gnc_commodity* pCommodity = GNC_COMMODITY(pObject);
 
@@ -97,7 +97,7 @@
 }
 
 static void 
-set_quote_source_name( gpointer pObject, const gpointer pValue )
+set_quote_source_name( gpointer pObject, gpointer pValue )
 {
 	gnc_commodity* pCommodity = GNC_COMMODITY(pObject);
 	const gchar* quote_source_name = (const gchar*)pValue;

Modified: gnucash/branches/gda-dev/src/backend/gda/gnc-lots-gda.c
===================================================================
--- gnucash/branches/gda-dev/src/backend/gda/gnc-lots-gda.c	2006-12-12 11:41:59 UTC (rev 15211)
+++ gnucash/branches/gda-dev/src/backend/gda/gnc-lots-gda.c	2006-12-14 02:30:19 UTC (rev 15212)
@@ -43,16 +43,16 @@
 
 #define TABLE_NAME "lots"
 
-static gpointer get_lot_account( gpointer pObject );
-static void set_lot_account( gpointer pObject, const gpointer pValue );
-static gpointer get_lot_is_closed( gpointer pObject );
-static void set_lot_is_closed( gpointer pObject, const gpointer pValue );
+static gpointer get_lot_account( gpointer pObject, const QofParam* param );
+static void set_lot_account( gpointer pObject, gpointer pValue );
+static gpointer get_lot_is_closed( gpointer pObject, const QofParam* param );
+static void set_lot_is_closed( gpointer pObject, gpointer pValue );
 
 static col_cvt_t col_table[] =
 {
 	{ "guid",			CT_GUID,	0, COL_NNUL|COL_PKEY,	NULL,
-			(GNC_GDA_FN_GETTER)qof_entity_get_guid,
-			(GNC_GDA_FN_SETTER)qof_entity_set_guid },
+			(QofAccessFunc)qof_entity_get_guid,
+			(QofSetterFunc)qof_entity_set_guid },
 	{ "account_guid",	CT_GUID,	  0, COL_NNUL,	NULL,
 			get_lot_account, set_lot_account },
 	{ "is_closed",		CT_STRING,  1, COL_NNUL, NULL,
@@ -62,7 +62,7 @@
 
 /* ================================================================= */
 static gpointer
-get_lot_account( gpointer pObject )
+get_lot_account( gpointer pObject, const QofParam* param )
 {
 	const GNCLot* lot = GNC_LOT(pObject);
 	const Account* pAccount = gnc_lot_get_account( lot );
@@ -71,7 +71,7 @@
 }
 
 static void 
-set_lot_account( gpointer pObject, const gpointer pValue )
+set_lot_account( gpointer pObject, gpointer pValue )
 {
 	GNCLot* lot = GNC_LOT(pObject);
 	QofBook* pBook = qof_instance_get_book( QOF_INSTANCE(lot) );
@@ -82,7 +82,7 @@
 }
 
 static gpointer
-get_lot_is_closed( gpointer pObject )
+get_lot_is_closed( gpointer pObject, const QofParam* param )
 {
 	GNCLot* lot = GNC_LOT(pObject);
 	static gboolean is_closed; 
@@ -92,7 +92,7 @@
 }
 
 static void
-set_lot_is_closed( gpointer pObject, const gpointer pValue )
+set_lot_is_closed( gpointer pObject, gpointer pValue )
 {
 	GNCLot* lot = GNC_LOT(pObject);
 	const gboolean* pBoolean = (const gboolean*)pValue;

Modified: gnucash/branches/gda-dev/src/backend/gda/gnc-price-gda.c
===================================================================
--- gnucash/branches/gda-dev/src/backend/gda/gnc-price-gda.c	2006-12-12 11:41:59 UTC (rev 15211)
+++ gnucash/branches/gda-dev/src/backend/gda/gnc-price-gda.c	2006-12-14 02:30:19 UTC (rev 15212)
@@ -43,14 +43,14 @@
 
 #define TABLE_NAME "prices"
 
-static gpointer get_value( gpointer pObject );
-static void set_value( gpointer pObject, const gpointer pValue );
-static gpointer get_date( gpointer pObject );
-static void set_date( gpointer pObject, const gpointer pValue );
-static gpointer get_currency( gpointer pObject );
-static void set_currency( gpointer pObject, const gpointer pValue );
-static gpointer get_commodity( gpointer pObject );
-static void set_commodity( gpointer pObject, const gpointer pValue );
+static gpointer get_value( gpointer pObject, const QofParam* param );
+static void set_value( gpointer pObject, gpointer pValue );
+static gpointer get_date( gpointer pObject, const QofParam* param );
+static void set_date( gpointer pObject, gpointer pValue );
+static gpointer get_currency_guid( gpointer pObject, const QofParam* param );
+static void set_currency_guid( gpointer pObject, gpointer pValue );
+static gpointer get_commodity_guid( gpointer pObject, const QofParam* param );
+static void set_commodity_guid( gpointer pObject, gpointer pValue );
 
 #define PRICE_MAX_SOURCE_LEN 50
 #define PRICE_MAX_TYPE_LEN 50
@@ -58,12 +58,12 @@
 static col_cvt_t col_table[] =
 {
 	{ "guid",			CT_GUID,	0, COL_NNUL|COL_PKEY,	NULL,
-			(GNC_GDA_FN_GETTER)qof_entity_get_guid,
-			(GNC_GDA_FN_SETTER)qof_entity_set_guid },
+			(QofAccessFunc)qof_entity_get_guid,
+			(QofSetterFunc)qof_entity_set_guid },
 	{ "commodity_guid",	CT_GUID,	0, COL_NNUL, NULL,
-			get_commodity, set_commodity },
+			get_commodity_guid, set_commodity_guid },
 	{ "currency_guid",	CT_GUID,	0, COL_NNUL, NULL,
-			get_currency, set_currency },
+			get_currency_guid, set_currency_guid },
 	{ "date",			CT_TIMESPEC,	0, COL_NNUL, NULL,
 			get_date, set_date },
 	{ "source",			CT_STRING,	PRICE_MAX_SOURCE_LEN, 0, PRICE_SOURCE },
@@ -74,7 +74,7 @@
 
 /* ================================================================= */
 static gpointer
-get_value( gpointer pObject )
+get_value( gpointer pObject, const QofParam* param )
 {
 	const GNCPrice* pPrice = GNC_PRICE(pObject);
 	static gnc_numeric v;
@@ -84,7 +84,7 @@
 }
 
 static void
-set_value( gpointer pObject, const gpointer pValue )
+set_value( gpointer pObject, gpointer pValue )
 {
 	GNCPrice* pPrice = GNC_PRICE(pObject);
 	const gnc_numeric* pNumeric = (const gnc_numeric*)pValue;
@@ -93,7 +93,7 @@
 }
 
 static gpointer
-get_date( gpointer pObject )
+get_date( gpointer pObject, const QofParam* param )
 {
 	const GNCPrice* pPrice = GNC_PRICE(pObject);
 	static Timespec t;
@@ -103,7 +103,7 @@
 }
 
 static void
-set_date( gpointer pObject, const gpointer pValue )
+set_date( gpointer pObject, gpointer pValue )
 {
 	GNCPrice* pPrice = GNC_PRICE(pObject);
 	const Timespec* pTimespec = (const Timespec*)pValue;
@@ -112,7 +112,7 @@
 }
 
 static gpointer
-get_currency( gpointer pObject )
+get_currency_guid( gpointer pObject, const QofParam* param )
 {
 	const GNCPrice* pPrice = GNC_PRICE(pObject);
 
@@ -121,7 +121,7 @@
 }
 
 static void 
-set_currency( gpointer pObject, const gpointer pValue )
+set_currency_guid( gpointer pObject, gpointer pValue )
 {
 	GNCPrice* pPrice = GNC_PRICE(pObject);
 	QofBook* pBook = qof_instance_get_book( QOF_INSTANCE(pPrice) );
@@ -133,7 +133,7 @@
 }
 
 static gpointer
-get_commodity( gpointer pObject )
+get_commodity_guid( gpointer pObject, const QofParam* param )
 {
 	const GNCPrice* pPrice = GNC_PRICE(pObject);
 
@@ -142,7 +142,7 @@
 }
 
 static void 
-set_commodity( gpointer pObject, const gpointer pValue )
+set_commodity_guid( gpointer pObject, gpointer pValue )
 {
 	GNCPrice* pPrice = GNC_PRICE(pObject);
 	QofBook* pBook = qof_instance_get_book( QOF_INSTANCE(pPrice) );

Modified: gnucash/branches/gda-dev/src/backend/gda/gnc-schedxaction-gda.c
===================================================================
--- gnucash/branches/gda-dev/src/backend/gda/gnc-schedxaction-gda.c	2006-12-12 11:41:59 UTC (rev 15211)
+++ gnucash/branches/gda-dev/src/backend/gda/gnc-schedxaction-gda.c	2006-12-14 02:30:19 UTC (rev 15212)
@@ -46,16 +46,16 @@
 
 #define SX_MAX_NAME_LEN 50
 
-static gpointer get_autocreate( gpointer pObject );
-static void set_autocreate( gpointer pObject, const gpointer pValue );
-static gpointer get_autonotify( gpointer pObject );
-static void set_autonotify( gpointer pObject, const gpointer pValue );
+static gpointer get_autocreate( gpointer pObject, const QofParam* param );
+static void set_autocreate( gpointer pObject, gpointer pValue );
+static gpointer get_autonotify( gpointer pObject, const QofParam* param );
+static void set_autonotify( gpointer pObject, gpointer pValue );
 
 static col_cvt_t col_table[] =
 {
 	{ "guid",			CT_GUID,	0, COL_NNUL|COL_PKEY,	NULL,
-			(GNC_GDA_FN_GETTER)qof_entity_get_guid,
-			(GNC_GDA_FN_SETTER)qof_entity_set_guid },
+			(QofAccessFunc)qof_entity_get_guid,
+			(QofSetterFunc)qof_entity_set_guid },
 	{ "name",			CT_STRING, SX_MAX_NAME_LEN, COL_NNUL, GNC_SX_NAME },
 	{ "start_date",		CT_GDATE,	0, COL_NNUL, GNC_SX_START_DATE },
 	{ "last_occur",		CT_GDATE,	0, COL_NNUL, GNC_SX_LAST_DATE },
@@ -66,18 +66,18 @@
 	{ "auto_notify",	CT_BOOLEAN,	0, COL_NNUL, NULL,
 			get_autonotify, set_autonotify },
 	{ "adv_creation",	CT_INT,		0, COL_NNUL, NULL,
-			(GNC_GDA_FN_GETTER)xaccSchedXactionGetAdvanceCreation,
-			(GNC_GDA_FN_SETTER)xaccSchedXactionSetAdvanceCreation },
+			(QofAccessFunc)xaccSchedXactionGetAdvanceCreation,
+			(QofSetterFunc)xaccSchedXactionSetAdvanceCreation },
 	{ "adv_notify",	CT_INT,		0, COL_NNUL, NULL,
-			(GNC_GDA_FN_GETTER)xaccSchedXactionGetAdvanceReminder,
-			(GNC_GDA_FN_SETTER)xaccSchedXactionSetAdvanceReminder },
+			(QofAccessFunc)xaccSchedXactionGetAdvanceReminder,
+			(QofSetterFunc)xaccSchedXactionSetAdvanceReminder },
 	{ NULL }
 };
 
 /* ================================================================= */
 
 static gpointer
-get_autocreate( gpointer pObject )
+get_autocreate( gpointer pObject, const QofParam* param )
 {
 	const SchedXaction* pSx = GNC_SX(pObject);
 	gboolean autoCreate;
@@ -88,7 +88,7 @@
 }
 
 static void 
-set_autocreate( gpointer pObject, const gpointer pValue )
+set_autocreate( gpointer pObject, gpointer pValue )
 {
 	SchedXaction* pSx = GNC_SX(pObject);
 	gboolean autoCreate;
@@ -100,7 +100,7 @@
 }
 
 static gpointer
-get_autonotify( gpointer pObject )
+get_autonotify( gpointer pObject, const QofParam* param )
 {
 	const SchedXaction* pSx = GNC_SX(pObject);
 	gboolean autoCreate;
@@ -111,7 +111,7 @@
 }
 
 static void 
-set_autonotify( gpointer pObject, const gpointer pValue )
+set_autonotify( gpointer pObject, gpointer pValue )
 {
 	SchedXaction* pSx = GNC_SX(pObject);
 	gboolean autoCreate;
@@ -137,7 +137,7 @@
 		pSx = xaccSchedXactionMalloc( be->primary_book );
 	}
 
-	gnc_gda_load_object( pModel, row, GNC_ID_SCHEDXACTION, pSx, col_table );
+	gnc_gda_load_object( pModel, row, /*GNC_ID_SCHEDXACTION*/GNC_SX_ID, pSx, col_table );
 	gnc_gda_slots_load( be, qof_entity_get_guid( QOF_ENTITY(pSx) ),
 							qof_instance_get_slots( QOF_INSTANCE(pSx) ) );
 
@@ -185,7 +185,7 @@
 	(void)gnc_gda_do_db_operation( be,
 						(inst->do_free ? OP_DB_DELETE : OP_DB_ADD_OR_UPDATE ),
 						SCHEDXACTION_TABLE,
-						GNC_ID_SCHEDXACTION, pSx,
+						/*GNC_ID_SCHEDXACTION*/GNC_SX_ID, pSx,
 						col_table );
 
 	// Delete old slot info

Modified: gnucash/branches/gda-dev/src/backend/gda/gnc-slots-gda.c
===================================================================
--- gnucash/branches/gda-dev/src/backend/gda/gnc-slots-gda.c	2006-12-12 11:41:59 UTC (rev 15211)
+++ gnucash/branches/gda-dev/src/backend/gda/gnc-slots-gda.c	2006-12-14 02:30:19 UTC (rev 15212)
@@ -51,26 +51,26 @@
 	GString* path;
 } slot_info_t;
 
-static gpointer get_slot_id( gpointer pObject );
-static void set_slot_id( gpointer pObject, const gpointer pValue );
-static gpointer get_obj_guid( gpointer pObject );
-static void set_obj_guid( gpointer pObject, const gpointer pValue );
-static gpointer get_path( gpointer pObject );
-static void set_path( gpointer pObject, const gpointer pValue );
-static gpointer get_slot_type( gpointer pObject );
-static void set_slot_type( gpointer pObject, const gpointer pValue );
-static gpointer get_int64_val( gpointer pObject );
-static void set_int64_val( gpointer pObject, const gpointer pValue );
-static gpointer get_string_val( gpointer pObject );
-static void set_string_val( gpointer pObject, const gpointer pValue );
-static gpointer get_double_val( gpointer pObject );
-static void set_double_val( gpointer pObject, const gpointer pValue );
-static gpointer get_timespec_val( gpointer pObject );
-static void set_timespec_val( gpointer pObject, const gpointer pValue );
-static gpointer get_guid_val( gpointer pObject );
-static void set_guid_val( gpointer pObject, const gpointer pValue );
-static gpointer get_numeric_val( gpointer pObject );
-static void set_numeric_val( gpointer pObject, const gpointer pValue );
+static gpointer get_slot_id( gpointer pObject, const QofParam* param );
+static void set_slot_id( gpointer pObject, gpointer pValue );
+static gpointer get_obj_guid( gpointer pObject, const QofParam* param );
+static void set_obj_guid( gpointer pObject, gpointer pValue );
+static gpointer get_path( gpointer pObject, const QofParam* param );
+static void set_path( gpointer pObject, gpointer pValue );
+static gpointer get_slot_type( gpointer pObject, const QofParam* param );
+static void set_slot_type( gpointer pObject, gpointer pValue );
+static gpointer get_int64_val( gpointer pObject, const QofParam* param );
+static void set_int64_val( gpointer pObject, gpointer pValue );
+static gpointer get_string_val( gpointer pObject, const QofParam* param );
+static void set_string_val( gpointer pObject, gpointer pValue );
+static gpointer get_double_val( gpointer pObject, const QofParam* param );
+static void set_double_val( gpointer pObject, gpointer pValue );
+static gpointer get_timespec_val( gpointer pObject, const QofParam* param );
+static void set_timespec_val( gpointer pObject, gpointer pValue );
+static gpointer get_guid_val( gpointer pObject, const QofParam* param );
+static void set_guid_val( gpointer pObject, gpointer pValue );
+static gpointer get_numeric_val( gpointer pObject, const QofParam* param );
+static void set_numeric_val( gpointer pObject, gpointer pValue );
 
 #define SLOT_MAX_PATHNAME_LEN 500
 #define SLOT_MAX_STRINGVAL_LEN 1000
@@ -112,7 +112,7 @@
 /* ================================================================= */
 
 static gpointer
-get_slot_id( gpointer pObject )
+get_slot_id( gpointer pObject, const QofParam* param )
 {
 	// Just need a 0 to force a new slot id
 	return (gpointer)0;
@@ -125,7 +125,7 @@
 }
 
 static gpointer
-get_obj_guid( gpointer pObject )
+get_obj_guid( gpointer pObject, const QofParam* param )
 {
 	slot_info_t* pInfo = (slot_info_t*)pObject;
 
@@ -139,7 +139,7 @@
 }
 
 static gpointer
-get_path( gpointer pObject )
+get_path( gpointer pObject, const QofParam* param )
 {
 	slot_info_t* pInfo = (slot_info_t*)pObject;
 
@@ -155,7 +155,7 @@
 }
 
 static gpointer
-get_slot_type( gpointer pObject )
+get_slot_type( gpointer pObject, const QofParam* param )
 {
 	slot_info_t* pInfo = (slot_info_t*)pObject;
 
@@ -171,7 +171,7 @@
 }
 
 static gpointer
-get_int64_val( gpointer pObject )
+get_int64_val( gpointer pObject, const QofParam* param )
 {
 	slot_info_t* pInfo = (slot_info_t*)pObject;
 	static gint64 i64_val;
@@ -185,7 +185,7 @@
 }
 
 static void
-set_int64_val( gpointer pObject, const gpointer pValue )
+set_int64_val( gpointer pObject, gpointer pValue )
 {
 	slot_info_t* pInfo = (slot_info_t*)pObject;
 
@@ -195,7 +195,7 @@
 }
 
 static gpointer
-get_string_val( gpointer pObject )
+get_string_val( gpointer pObject, const QofParam* param )
 {
 	slot_info_t* pInfo = (slot_info_t*)pObject;
 
@@ -207,7 +207,7 @@
 }
 
 static void
-set_string_val( gpointer pObject, const gpointer pValue )
+set_string_val( gpointer pObject, gpointer pValue )
 {
 	slot_info_t* pInfo = (slot_info_t*)pObject;
 
@@ -217,7 +217,7 @@
 }
 
 static gpointer
-get_double_val( gpointer pObject )
+get_double_val( gpointer pObject, const QofParam* param )
 {
 	slot_info_t* pInfo = (slot_info_t*)pObject;
 	static double d_val;
@@ -231,7 +231,7 @@
 }
 
 static void
-set_double_val( gpointer pObject, const gpointer pValue )
+set_double_val( gpointer pObject, gpointer pValue )
 {
 	slot_info_t* pInfo = (slot_info_t*)pObject;
 
@@ -241,7 +241,7 @@
 }
 
 static gpointer
-get_timespec_val( gpointer pObject )
+get_timespec_val( gpointer pObject, const QofParam* param )
 {
 	slot_info_t* pInfo = (slot_info_t*)pObject;
 	static Timespec ts;
@@ -255,7 +255,7 @@
 }
 
 static void
-set_timespec_val( gpointer pObject, const gpointer pValue )
+set_timespec_val( gpointer pObject, gpointer pValue )
 {
 	slot_info_t* pInfo = (slot_info_t*)pObject;
 
@@ -265,7 +265,7 @@
 }
 
 static gpointer
-get_guid_val( gpointer pObject )
+get_guid_val( gpointer pObject, const QofParam* param )
 {
 	slot_info_t* pInfo = (slot_info_t*)pObject;
 
@@ -277,7 +277,7 @@
 }
 
 static void
-set_guid_val( gpointer pObject, const gpointer pValue )
+set_guid_val( gpointer pObject, gpointer pValue )
 {
 	slot_info_t* pInfo = (slot_info_t*)pObject;
 
@@ -287,7 +287,7 @@
 }
 
 static gpointer
-get_numeric_val( gpointer pObject )
+get_numeric_val( gpointer pObject, const QofParam* param )
 {
 	slot_info_t* pInfo = (slot_info_t*)pObject;
 	static gnc_numeric n_val;
@@ -301,7 +301,7 @@
 }
 
 static void
-set_numeric_val( gpointer pObject, const gpointer pValue )
+set_numeric_val( gpointer pObject, gpointer pValue )
 {
 	slot_info_t* pInfo = (slot_info_t*)pObject;
 

Modified: gnucash/branches/gda-dev/src/backend/gda/gnc-transaction-gda.c
===================================================================
--- gnucash/branches/gda-dev/src/backend/gda/gnc-transaction-gda.c	2006-12-12 11:41:59 UTC (rev 15211)
+++ gnucash/branches/gda-dev/src/backend/gda/gnc-transaction-gda.c	2006-12-14 02:30:19 UTC (rev 15212)
@@ -56,16 +56,16 @@
 	const GUID* guid;
 } split_info_t;
 
-static gpointer get_guid( gpointer pObject );
-static void set_guid( gpointer pObject, const gpointer pValue );
-static gpointer get_tx_currency( gpointer pObject );
-static void set_tx_currency( gpointer pObject, const gpointer pValue );
-static gpointer get_tx_num( gpointer pObject );
-static void set_tx_num( gpointer pObject, const gpointer pValue );
-static gpointer get_tx_post_date( gpointer pObject );
-static void set_tx_post_date( gpointer pObject, const gpointer pValue );
-static gpointer get_tx_enter_date( gpointer pObject );
-static void set_tx_enter_date( gpointer pObject, const gpointer pValue );
+static gpointer get_guid( gpointer pObject, const QofParam* param );
+static void set_guid( gpointer pObject, gpointer pValue );
+static gpointer get_tx_currency_guid( gpointer pObject, const QofParam* param );
+static void set_tx_currency_guid( gpointer pObject, gpointer pValue );
+static gpointer get_tx_num( gpointer pObject, const QofParam* param );
+static void set_tx_num( gpointer pObject, gpointer pValue );
+static gpointer get_tx_post_date( gpointer pObject, const QofParam* param );
+static void set_tx_post_date( gpointer pObject, gpointer pValue );
+static gpointer get_tx_enter_date( gpointer pObject, const QofParam* param );
+static void set_tx_enter_date( gpointer pObject, gpointer pValue );
 
 #define TX_MAX_NUM_LEN 50
 #define TX_MAX_DESCRIPTION_LEN 500
@@ -75,7 +75,7 @@
 	{ "guid",			CT_GUID,	0, COL_NNUL|COL_PKEY, NULL,
 			get_guid, set_guid },
 	{ "currency_guid",	CT_GUID,	0, COL_NNUL,	NULL,
-			get_tx_currency, set_tx_currency },
+			get_tx_currency_guid, set_tx_currency_guid },
 	{ "num",			CT_STRING,	TX_MAX_NUM_LEN, COL_NNUL, NULL,
 			get_tx_num, set_tx_num },
 	{ "post_date",		CT_TIMESPEC, 0, COL_NNUL, NULL,
@@ -83,23 +83,23 @@
 	{ "enter_date",		CT_TIMESPEC, 0, COL_NNUL, NULL,
 			get_tx_enter_date, set_tx_enter_date },
 	{ "description",	CT_STRING,	TX_MAX_DESCRIPTION_LEN, 0,	NULL,
-			(GNC_GDA_FN_GETTER)xaccTransGetDescription,
-			(GNC_GDA_FN_SETTER)xaccTransSetDescription },
+			(QofAccessFunc)xaccTransGetDescription,
+			(QofSetterFunc)xaccTransSetDescription },
 	{ NULL }
 };
 
-static gpointer get_split_tx_guid( gpointer pObject );
-static void set_split_tx_guid( gpointer pObject, const gpointer pValue );
-static gpointer get_split_reconcile_state( gpointer pObject );
-static void set_split_reconcile_state( gpointer pObject, const gpointer pValue );
-static gpointer get_split_reconcile_date( gpointer pObject );
-static void set_split_reconcile_date( gpointer pObject, const gpointer pValue );
-static gpointer get_split_value( gpointer pObject );
-static void set_split_value( gpointer pObject, const gpointer pValue );
-static gpointer get_split_quantity( gpointer pObject );
-static void set_split_quantity( gpointer pObject, const gpointer pValue );
-static gpointer get_split_account( gpointer pObject );
-static void set_split_account( gpointer pObject, const gpointer pValue );
+static gpointer get_split_tx_guid( gpointer pObject, const QofParam* param );
+static void set_split_tx_guid( gpointer pObject, gpointer pValue );
+static gpointer get_split_reconcile_state( gpointer pObject, const QofParam* param );
+static void set_split_reconcile_state( gpointer pObject, gpointer pValue );
+static gpointer get_split_reconcile_date( gpointer pObject, const QofParam* param );
+static void set_split_reconcile_date( gpointer pObject, gpointer pValue );
+static gpointer get_split_value( gpointer pObject, const QofParam* param );
+static void set_split_value( gpointer pObject, gpointer pValue );
+static gpointer get_split_quantity( gpointer pObject, const QofParam* param );
+static void set_split_quantity( gpointer pObject, gpointer pValue );
+static gpointer get_split_account_guid( gpointer pObject, const QofParam* param );
+static void set_split_account_guid( gpointer pObject, gpointer pValue );
 
 #define SPLIT_MAX_MEMO_LEN 50
 #define SPLIT_MAX_ACTION_LEN 50
@@ -121,7 +121,7 @@
 	{ "quantity",		CT_NUMERIC,	 0, COL_NNUL,	NULL,
 			get_split_quantity, set_split_quantity },
 	{ "account_guid",	CT_GUID,	 0, COL_NNUL,	NULL,
-			get_split_account, set_split_account },
+			get_split_account_guid, set_split_account_guid },
 	{ NULL }
 };
 
@@ -133,13 +133,13 @@
 
 /* ================================================================= */
 static gpointer
-get_guid( gpointer pObject )
+get_guid( gpointer pObject, const QofParam* param )
 {
 	return (gpointer)qof_entity_get_guid( QOF_ENTITY(pObject) );
 }
 
 static void 
-set_guid( gpointer pObject, const gpointer pValue )
+set_guid( gpointer pObject, gpointer pValue )
 {
 	QofEntity* pEntity = QOF_ENTITY(pObject);
 	GUID* guid = (GUID*)pValue;
@@ -148,7 +148,7 @@
 }
 
 static gpointer
-get_tx_currency( gpointer pObject )
+get_tx_currency_guid( gpointer pObject, const QofParam* param )
 {
 	const Transaction* pTx = GNC_TRANS(pObject);
 
@@ -157,7 +157,7 @@
 }
 
 static void 
-set_tx_currency( gpointer pObject, const gpointer pValue )
+set_tx_currency_guid( gpointer pObject, gpointer pValue )
 {
 	Transaction* pTx = GNC_TRANS(pObject);
 	QofBook* pBook = qof_instance_get_book( QOF_INSTANCE(pTx) );
@@ -169,7 +169,7 @@
 }
 
 static gpointer
-get_tx_num( gpointer pObject )
+get_tx_num( gpointer pObject, const QofParam* param )
 {
 	const Transaction* pTx = GNC_TRANS(pObject);
 	const gchar* s;
@@ -179,7 +179,7 @@
 }
 
 static void 
-set_tx_num( gpointer pObject, const gpointer pValue )
+set_tx_num( gpointer pObject, gpointer pValue )
 {
 	Transaction* pTx = GNC_TRANS(pObject);
 	const gchar* s = (const gchar*)pValue;
@@ -188,7 +188,7 @@
 }
 
 static gpointer
-get_tx_post_date( gpointer pObject )
+get_tx_post_date( gpointer pObject, const QofParam* param )
 {
 	const Transaction* pTx = GNC_TRANS(pObject);
 	static Timespec ts;
@@ -198,7 +198,7 @@
 }
 
 static void 
-set_tx_post_date( gpointer pObject, const gpointer pValue )
+set_tx_post_date( gpointer pObject, gpointer pValue )
 {
 	Transaction* pTx = GNC_TRANS(pObject);
 	Timespec* pTS = (Timespec*)pValue;
@@ -207,7 +207,7 @@
 }
 
 static gpointer
-get_tx_enter_date( gpointer pObject )
+get_tx_enter_date( gpointer pObject, const QofParam* param )
 {
 	const Transaction* pTx = GNC_TRANS(pObject);
 	static Timespec ts;
@@ -217,7 +217,7 @@
 }
 
 static void 
-set_tx_enter_date( gpointer pObject, const gpointer pValue )
+set_tx_enter_date( gpointer pObject, gpointer pValue )
 {
 	Transaction* pTx = GNC_TRANS(pObject);
 	Timespec* pTS = (Timespec*)pValue;
@@ -226,7 +226,7 @@
 }
 
 static gpointer
-get_split_tx_guid( gpointer pObject )
+get_split_tx_guid( gpointer pObject, const QofParam* param )
 {
 	const Split* pSplit = GNC_SPLIT(pObject);
 	Transaction* pTx = xaccSplitGetParent( pSplit );
@@ -235,7 +235,7 @@
 }
 
 static void 
-set_split_tx_guid( gpointer pObject, const gpointer pValue )
+set_split_tx_guid( gpointer pObject, gpointer pValue )
 {
 	Split* pSplit = GNC_SPLIT(pObject);
 	QofBook* pBook = qof_instance_get_book( QOF_INSTANCE(pSplit) );
@@ -246,7 +246,7 @@
 }
 
 static gpointer
-get_split_reconcile_state( gpointer pObject )
+get_split_reconcile_state( gpointer pObject, const QofParam* param )
 {
 	const Split* pSplit = GNC_SPLIT(pObject);
 	static gchar c[2];
@@ -257,7 +257,7 @@
 }
 
 static void 
-set_split_reconcile_state( gpointer pObject, const gpointer pValue )
+set_split_reconcile_state( gpointer pObject, gpointer pValue )
 {
 	Split* pSplit = GNC_SPLIT(pObject);
 	const gchar* s = (const gchar*)pValue;
@@ -266,7 +266,7 @@
 }
 
 static gpointer
-get_split_reconcile_date( gpointer pObject )
+get_split_reconcile_date( gpointer pObject, const QofParam* param )
 {
 	const Split* pSplit = GNC_SPLIT(pObject);
 	static Timespec ts;
@@ -276,7 +276,7 @@
 }
 
 static void 
-set_split_reconcile_date( gpointer pObject, const gpointer pValue )
+set_split_reconcile_date( gpointer pObject, gpointer pValue )
 {
 	Split* pSplit = GNC_SPLIT(pObject);
 	Timespec* pTS = (Timespec*)pValue;
@@ -285,7 +285,7 @@
 }
 
 static gpointer
-get_split_value( gpointer pObject )
+get_split_value( gpointer pObject, const QofParam* param )
 {
 	const Split* pSplit = GNC_SPLIT(pObject);
 	static gnc_numeric v;
@@ -295,7 +295,7 @@
 }
 
 static void 
-set_split_value( gpointer pObject, const gpointer pValue )
+set_split_value( gpointer pObject, gpointer pValue )
 {
 	Split* pSplit = GNC_SPLIT(pObject);
 	gnc_numeric* pV = (gnc_numeric*)pValue;
@@ -304,7 +304,7 @@
 }
 
 static gpointer
-get_split_quantity( gpointer pObject )
+get_split_quantity( gpointer pObject, const QofParam* param )
 {
 	const Split* pSplit = GNC_SPLIT(pObject);
 	static gnc_numeric v;
@@ -314,7 +314,7 @@
 }
 
 static void 
-set_split_quantity( gpointer pObject, const gpointer pValue )
+set_split_quantity( gpointer pObject, gpointer pValue )
 {
 	Split* pSplit = GNC_SPLIT(pObject);
 	gnc_numeric* pV = (gnc_numeric*)pValue;
@@ -323,7 +323,7 @@
 }
 
 static gpointer
-get_split_account( gpointer pObject )
+get_split_account_guid( gpointer pObject, const QofParam* param )
 {
 	const Split* pSplit = GNC_SPLIT(pObject);
 	Account* pAccount = xaccSplitGetAccount( pSplit );
@@ -332,7 +332,7 @@
 }
 
 static void 
-set_split_account( gpointer pObject, const gpointer pValue )
+set_split_account_guid( gpointer pObject, gpointer pValue )
 {
 	Split* pSplit = GNC_SPLIT(pObject);
 	QofBook* pBook = qof_instance_get_book( QOF_INSTANCE(pSplit) );
@@ -434,39 +434,7 @@
 	return pTx;
 }
 
-#if 0
 static void
-load_transactions( GncGdaBackend* be, const GUID* guid )
-{
-	GdaQuery* query;
-	GdaObject* ret;
-	gchar guid_buf[GUID_ENCODING_LENGTH+1];
-	GValue value;
-	GdaQueryCondition* cond;
-
-	guid_to_string_buff( guid, guid_buf );
-	memset( &value, 0, sizeof( GValue ) );
-	g_value_init( &value, G_TYPE_STRING );
-	g_value_set_string( &value, guid_buf );
-	query = gnc_gda_create_select_query( be, TRANSACTION_TABLE );
-	cond = gnc_gda_create_condition_from_field( query, "guid", &value );
-	gda_query_set_condition( query, cond );
-	g_object_unref( G_OBJECT(cond) );
-
-	ret = gnc_gda_execute_query( be, query );
-	if( GDA_IS_DATA_MODEL( ret ) ) {
-		GdaDataModel* pModel = GDA_DATA_MODEL(ret);
-		int numRows = gda_data_model_get_n_rows( pModel );
-		int r;
-
-		for( r = 0; r < numRows; r++ ) {
-			load_tx( be, pModel, r, NULL );
-		}
-	}
-}
-#endif
-
-static void
 query_transactions( GncGdaBackend* be, GdaQuery* query )
 {
 	GdaObject* ret;
@@ -568,9 +536,20 @@
 	delete_splits( be, pTx );
 
 	if( !inst->do_free ) {
+		SplitList* splits;
+
 		// Now, commit any slots and splits
 		gnc_gda_slots_save( be, guid, qof_instance_get_slots( inst ) );
-		save_splits( be, guid, xaccTransGetSplitList( pTx ) );
+		splits = xaccTransGetSplitList( pTx );
+		save_splits( be, guid, splits );
+
+		/* Mark the splits as clean */
+		splits = xaccTransGetSplitList( pTx );
+		for( ; splits != NULL; splits = splits->next ) {
+			QofInstance* inst = QOF_INSTANCE(splits->data);
+
+			inst->dirty = FALSE;
+		}
 	} else {
 		gnc_gda_slots_delete( be, guid );
 	}



More information about the gnucash-changes mailing list