r15105 - gnucash/branches/gda-dev - 1) Use getter/setter functions to transfer from objects <-> db

Derek Atkins warlord at MIT.EDU
Fri Nov 24 15:53:33 EST 2006


Phil,

Phil Longstaff <plongstaff at cvs.gnucash.org> writes:

> +static col_cvt_t col_table[] =
> +{
> +	{ "guid",			CT_GUID,	  0, COL_NNUL|COL_PKEY,
> +			(GNC_GDA_FN_GETTER)qof_entity_get_guid,
> +			(GNC_GDA_FN_SETTER)xaccAccountSetGUID },
> +	{ "name",			CT_STRING,	 50, COL_NNUL,
> +			NULL, NULL, ACCOUNT_NAME_ },
> +	{ "account_type",	CT_INT,		  0, COL_NNUL,
> +			(GNC_GDA_FN_GETTER)xaccAccountGetType,
> +			(GNC_GDA_FN_SETTER)xaccAccountSetType },
> +	{ "commodity_guid",	CT_GUID,	  0, COL_NNUL,
> +			get_commodity, set_commodity },
> +	{ "parent_guid",	CT_GUID,	  0, 0,	get_parent, set_parent },
> +	{ "code",			CT_STRING,	100, 0,
> +			NULL, NULL, ACCOUNT_CODE_ },
> +	{ "description",	CT_STRING,	500, 0,
> +			NULL, NULL, ACCOUNT_DESCRIPTION_ },
> +	{ NULL }
> +};

This looks like a close duplication to the table in src/engine/Account.c.
How hard would it be to just use that instead of rebuilding it here?
I'll note that if we need to make small QOF changes so we don't need
to duplicate the Parameter Tables then that would be a GOOD THING.  :)

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-devel mailing list