Take advantage of the initial property definition for Transaction, Split, GNCPrice and SchedXaction by replacing custom access routines with gobject properties.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18763 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Phil Longstaff 2010-02-28 17:36:49 +00:00
parent 181286c970
commit dc65c95b77
3 changed files with 7 additions and 9 deletions

View File

@ -58,8 +58,8 @@ static const GncSqlColumnTableEntry col_table[] =
{ "commodity_guid", CT_COMMODITYREF, 0, COL_NNUL, NULL, PRICE_COMMODITY },
{ "currency_guid", CT_COMMODITYREF, 0, COL_NNUL, NULL, PRICE_CURRENCY },
{ "date", CT_TIMESPEC, 0, COL_NNUL, NULL, PRICE_DATE },
{ "source", CT_STRING, PRICE_MAX_SOURCE_LEN, 0, NULL, PRICE_SOURCE },
{ "type", CT_STRING, PRICE_MAX_TYPE_LEN, 0, NULL, PRICE_TYPE },
{ "source", CT_STRING, PRICE_MAX_SOURCE_LEN, 0, "source" },
{ "type", CT_STRING, PRICE_MAX_TYPE_LEN, 0, "type" },
{ "value", CT_NUMERIC, 0, COL_NNUL, NULL, PRICE_VALUE },
{ NULL }
/*@ +full_init_block @*/

View File

@ -67,7 +67,7 @@ static const GncSqlColumnTableEntry col_table[] =
{
/*@ -full_init_block @*/
{ "guid", CT_GUID, 0, COL_NNUL|COL_PKEY, "guid" },
{ "name", CT_STRING, SX_MAX_NAME_LEN, 0, NULL, GNC_SX_NAME },
{ "name", CT_STRING, SX_MAX_NAME_LEN, 0, "name" },
{ "enabled", CT_BOOLEAN, 0, COL_NNUL, NULL, NULL,
(QofAccessFunc)xaccSchedXactionGetEnabled, (QofSetterFunc)xaccSchedXactionSetEnabled },
{ "start_date", CT_GDATE, 0, 0, NULL, GNC_SX_START_DATE },

View File

@ -78,14 +78,12 @@ static const GncSqlColumnTableEntry tx_col_table[] =
{ "guid", CT_GUID, 0, COL_NNUL|COL_PKEY, "guid" },
{ "currency_guid", CT_COMMODITYREF, 0, COL_NNUL, NULL, NULL,
(QofAccessFunc)xaccTransGetCurrency, (QofSetterFunc)xaccTransSetCurrency },
{ "num", CT_STRING, TX_MAX_NUM_LEN, COL_NNUL, NULL, NULL,
(QofAccessFunc)xaccTransGetNum, (QofSetterFunc)xaccTransSetNum },
{ "num", CT_STRING, TX_MAX_NUM_LEN, COL_NNUL, "num" },
{ "post_date", CT_TIMESPEC, 0, 0, NULL, NULL,
(QofAccessFunc)xaccTransRetDatePostedTS, (QofSetterFunc)gnc_transaction_set_date_posted },
{ "enter_date", CT_TIMESPEC, 0, 0, NULL, NULL,
(QofAccessFunc)xaccTransRetDateEnteredTS, (QofSetterFunc)gnc_transaction_set_date_entered },
{ "description", CT_STRING, TX_MAX_DESCRIPTION_LEN, 0, NULL, NULL,
(QofAccessFunc)xaccTransGetDescription, (QofSetterFunc)xaccTransSetDescription },
{ "description", CT_STRING, TX_MAX_DESCRIPTION_LEN, 0, "description" },
{ NULL }
/*@ +full_init_block @*/
};
@ -104,8 +102,8 @@ static const GncSqlColumnTableEntry split_col_table[] =
{ "guid", CT_GUID, 0, COL_NNUL|COL_PKEY, "guid" },
{ "tx_guid", CT_TXREF, 0, COL_NNUL, NULL, SPLIT_TRANS },
{ "account_guid", CT_ACCOUNTREF, 0, COL_NNUL, NULL, SPLIT_ACCOUNT },
{ "memo", CT_STRING, SPLIT_MAX_MEMO_LEN, COL_NNUL, NULL, SPLIT_MEMO },
{ "action", CT_STRING, SPLIT_MAX_ACTION_LEN, COL_NNUL, NULL, SPLIT_ACTION },
{ "memo", CT_STRING, SPLIT_MAX_MEMO_LEN, COL_NNUL, "memo" },
{ "action", CT_STRING, SPLIT_MAX_ACTION_LEN, COL_NNUL, "action" },
{ "reconcile_state", CT_STRING, 1, COL_NNUL, NULL, NULL,
(QofAccessFunc)get_split_reconcile_state, set_split_reconcile_state },
{ "reconcile_date", CT_TIMESPEC, 0, 0, NULL, NULL,