fix/simplify kvp usage

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9518 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 2003-10-15 22:28:43 +00:00
parent 5be6a91fc6
commit 4c0b5bb787

View File

@ -47,59 +47,32 @@ static short module = MOD_IMPORT;
const gchar * gnc_import_get_acc_online_id(Account * account)
{
gchar * string = NULL;
kvp_frame * frame;
kvp_value * value;
frame = xaccAccountGetSlots(account);
value = kvp_frame_get_slot(frame, "online_id");
string = kvp_value_get_string(value);
return string;
return kvp_frame_get_string(frame, "online_id");
}
void gnc_import_set_acc_online_id(Account * account,
const gchar * string_value)
{
kvp_frame * frame;
kvp_value * value;
frame = xaccAccountGetSlots(account);
if(frame==NULL)
{
DEBUG("The kvp_frame was NULL, allocating new one\n");
frame = kvp_frame_new();
}
value = kvp_frame_get_slot(frame, "online_id");
value = kvp_value_new_string(string_value);
kvp_frame_set_slot(frame,"online_id",value);
xaccAccountSetSlots_nc(account,frame);
return;
kvp_frame_set_string(frame, "online_id", string_value);
}
const gchar * gnc_import_get_trans_online_id(Transaction * transaction)
{
gchar * string = NULL;
kvp_frame * frame;
kvp_value * value;
frame = xaccTransGetSlots(transaction);
value = kvp_frame_get_slot(frame, "online_id");
string = kvp_value_get_string(value);
return string;
return kvp_frame_get_string(frame, "online_id");
}
void gnc_import_set_trans_online_id(Transaction * transaction,
const gchar * string_value)
{
kvp_frame * frame;
kvp_value * value;
frame = xaccTransGetSlots(transaction);
if(frame==NULL)
{
DEBUG("The kvp_frame was NULL, allocating new one");
frame = kvp_frame_new();
}
value = kvp_value_new_string(string_value);
kvp_frame_set_slot(frame,"online_id",value);
xaccTransSetSlots_nc(transaction,frame);
return;
kvp_frame_set_string (frame, "online_id", string_value);
}
/* @} */