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 }, { "commodity_guid", CT_COMMODITYREF, 0, COL_NNUL, NULL, PRICE_COMMODITY },
{ "currency_guid", CT_COMMODITYREF, 0, COL_NNUL, NULL, PRICE_CURRENCY }, { "currency_guid", CT_COMMODITYREF, 0, COL_NNUL, NULL, PRICE_CURRENCY },
{ "date", CT_TIMESPEC, 0, COL_NNUL, NULL, PRICE_DATE }, { "date", CT_TIMESPEC, 0, COL_NNUL, NULL, PRICE_DATE },
{ "source", CT_STRING, PRICE_MAX_SOURCE_LEN, 0, NULL, PRICE_SOURCE }, { "source", CT_STRING, PRICE_MAX_SOURCE_LEN, 0, "source" },
{ "type", CT_STRING, PRICE_MAX_TYPE_LEN, 0, NULL, PRICE_TYPE }, { "type", CT_STRING, PRICE_MAX_TYPE_LEN, 0, "type" },
{ "value", CT_NUMERIC, 0, COL_NNUL, NULL, PRICE_VALUE }, { "value", CT_NUMERIC, 0, COL_NNUL, NULL, PRICE_VALUE },
{ NULL } { NULL }
/*@ +full_init_block @*/ /*@ +full_init_block @*/

View File

@ -67,7 +67,7 @@ static const GncSqlColumnTableEntry col_table[] =
{ {
/*@ -full_init_block @*/ /*@ -full_init_block @*/
{ "guid", CT_GUID, 0, COL_NNUL|COL_PKEY, "guid" }, { "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, { "enabled", CT_BOOLEAN, 0, COL_NNUL, NULL, NULL,
(QofAccessFunc)xaccSchedXactionGetEnabled, (QofSetterFunc)xaccSchedXactionSetEnabled }, (QofAccessFunc)xaccSchedXactionGetEnabled, (QofSetterFunc)xaccSchedXactionSetEnabled },
{ "start_date", CT_GDATE, 0, 0, NULL, GNC_SX_START_DATE }, { "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" }, { "guid", CT_GUID, 0, COL_NNUL|COL_PKEY, "guid" },
{ "currency_guid", CT_COMMODITYREF, 0, COL_NNUL, NULL, NULL, { "currency_guid", CT_COMMODITYREF, 0, COL_NNUL, NULL, NULL,
(QofAccessFunc)xaccTransGetCurrency, (QofSetterFunc)xaccTransSetCurrency }, (QofAccessFunc)xaccTransGetCurrency, (QofSetterFunc)xaccTransSetCurrency },
{ "num", CT_STRING, TX_MAX_NUM_LEN, COL_NNUL, NULL, NULL, { "num", CT_STRING, TX_MAX_NUM_LEN, COL_NNUL, "num" },
(QofAccessFunc)xaccTransGetNum, (QofSetterFunc)xaccTransSetNum },
{ "post_date", CT_TIMESPEC, 0, 0, NULL, NULL, { "post_date", CT_TIMESPEC, 0, 0, NULL, NULL,
(QofAccessFunc)xaccTransRetDatePostedTS, (QofSetterFunc)gnc_transaction_set_date_posted }, (QofAccessFunc)xaccTransRetDatePostedTS, (QofSetterFunc)gnc_transaction_set_date_posted },
{ "enter_date", CT_TIMESPEC, 0, 0, NULL, NULL, { "enter_date", CT_TIMESPEC, 0, 0, NULL, NULL,
(QofAccessFunc)xaccTransRetDateEnteredTS, (QofSetterFunc)gnc_transaction_set_date_entered }, (QofAccessFunc)xaccTransRetDateEnteredTS, (QofSetterFunc)gnc_transaction_set_date_entered },
{ "description", CT_STRING, TX_MAX_DESCRIPTION_LEN, 0, NULL, NULL, { "description", CT_STRING, TX_MAX_DESCRIPTION_LEN, 0, "description" },
(QofAccessFunc)xaccTransGetDescription, (QofSetterFunc)xaccTransSetDescription },
{ NULL } { NULL }
/*@ +full_init_block @*/ /*@ +full_init_block @*/
}; };
@ -104,8 +102,8 @@ static const GncSqlColumnTableEntry split_col_table[] =
{ "guid", CT_GUID, 0, COL_NNUL|COL_PKEY, "guid" }, { "guid", CT_GUID, 0, COL_NNUL|COL_PKEY, "guid" },
{ "tx_guid", CT_TXREF, 0, COL_NNUL, NULL, SPLIT_TRANS }, { "tx_guid", CT_TXREF, 0, COL_NNUL, NULL, SPLIT_TRANS },
{ "account_guid", CT_ACCOUNTREF, 0, COL_NNUL, NULL, SPLIT_ACCOUNT }, { "account_guid", CT_ACCOUNTREF, 0, COL_NNUL, NULL, SPLIT_ACCOUNT },
{ "memo", CT_STRING, SPLIT_MAX_MEMO_LEN, COL_NNUL, NULL, SPLIT_MEMO }, { "memo", CT_STRING, SPLIT_MAX_MEMO_LEN, COL_NNUL, "memo" },
{ "action", CT_STRING, SPLIT_MAX_ACTION_LEN, COL_NNUL, NULL, SPLIT_ACTION }, { "action", CT_STRING, SPLIT_MAX_ACTION_LEN, COL_NNUL, "action" },
{ "reconcile_state", CT_STRING, 1, COL_NNUL, NULL, NULL, { "reconcile_state", CT_STRING, 1, COL_NNUL, NULL, NULL,
(QofAccessFunc)get_split_reconcile_state, set_split_reconcile_state }, (QofAccessFunc)get_split_reconcile_state, set_split_reconcile_state },
{ "reconcile_date", CT_TIMESPEC, 0, 0, NULL, NULL, { "reconcile_date", CT_TIMESPEC, 0, 0, NULL, NULL,