mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Add some begin_edit/commit_edit checks.
BP git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15856 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
7e6d9f8a5f
commit
13d841930b
@ -1303,9 +1303,11 @@ xaccAccountSetCommodity (Account * acc, gnc_commodity * com)
|
||||
if (gnc_commodity_is_iso(com)) {
|
||||
/* compatability hack - Gnucash 1.8 gets currency quotes when a
|
||||
non-default currency is assigned to an account. */
|
||||
gnc_commodity_begin_edit(com);
|
||||
gnc_commodity_set_quote_flag(com, TRUE);
|
||||
gnc_commodity_set_quote_source(com,
|
||||
gnc_commodity_get_default_quote_source(com));
|
||||
gnc_commodity_commit_edit(com);
|
||||
}
|
||||
xaccAccountCommitEdit(acc);
|
||||
}
|
||||
|
@ -99,13 +99,13 @@ gnc_budget_free(QofInstance *inst)
|
||||
|
||||
static void noop (QofInstance *inst) {}
|
||||
|
||||
static void
|
||||
void
|
||||
gnc_budget_begin_edit(GncBudget *bgt)
|
||||
{
|
||||
qof_begin_edit(QOF_INSTANCE(bgt));
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
gnc_budget_commit_edit(GncBudget *bgt)
|
||||
{
|
||||
if (!qof_commit_edit(QOF_INSTANCE(bgt))) return;
|
||||
@ -128,9 +128,11 @@ gnc_budget_new(QofBook *book)
|
||||
g_date_subtract_days(&date, g_date_get_day(&date)-1);
|
||||
recurrenceSet(&budget->recurrence, 1, PERIOD_MONTH, &date);
|
||||
|
||||
gnc_budget_begin_edit(budget);
|
||||
gnc_budget_set_name(budget, _("Unnamed Budget"));
|
||||
gnc_budget_set_description(budget, "");
|
||||
gnc_budget_set_num_periods(budget, 12);
|
||||
gnc_budget_commit_edit(budget);
|
||||
|
||||
qof_event_gen( &budget->inst, QOF_EVENT_CREATE , NULL);
|
||||
|
||||
|
@ -100,6 +100,9 @@ GncBudget *gnc_budget_new(QofBook *book);
|
||||
/** Deletes the given budget object.*/
|
||||
void gnc_budget_destroy(GncBudget* budget);
|
||||
|
||||
void gnc_budget_begin_edit(GncBudget *bgt);
|
||||
void gnc_budget_commit_edit(GncBudget *bgt);
|
||||
|
||||
const GUID* gnc_budget_get_guid(GncBudget* budget);
|
||||
#define gnc_budget_return_guid(X) \
|
||||
(X ? *(qof_instance_get_guid(QOF_INSTANCE(X))) : *(guid_null()))
|
||||
|
Loading…
Reference in New Issue
Block a user