r15961 - gnucash/branches/2.0 - Add some begin_edit/commit_edit checks.
Derek Atkins
warlord at cvs.gnucash.org
Sat Apr 21 15:18:48 EDT 2007
Author: warlord
Date: 2007-04-21 15:18:44 -0400 (Sat, 21 Apr 2007)
New Revision: 15961
Trac: http://svn.gnucash.org/trac/changeset/15961
Modified:
gnucash/branches/2.0/
gnucash/branches/2.0/ChangeLog
gnucash/branches/2.0/src/engine/Account.c
gnucash/branches/2.0/src/engine/gnc-budget.c
gnucash/branches/2.0/src/engine/gnc-budget.h
Log:
Add some begin_edit/commit_edit checks.
Merge from r15856
Property changes on: gnucash/branches/2.0
___________________________________________________________________
Name: svk:merge
- 3889ce50-311e-0410-a464-f059747ec5d1:/local/gnucash/branches/2.0:697
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/branches/2.0:14581
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk:13282
+ 3889ce50-311e-0410-a464-f059747ec5d1:/local/gnucash/branches/2.0:697
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/branches/2.0:14582
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk:13282
Modified: gnucash/branches/2.0/ChangeLog
===================================================================
--- gnucash/branches/2.0/ChangeLog 2007-04-21 19:18:19 UTC (rev 15960)
+++ gnucash/branches/2.0/ChangeLog 2007-04-21 19:18:44 UTC (rev 15961)
@@ -1,3 +1,7 @@
+2007-04-21 David Hampton <hampton at employees.org>
+
+ * Add some begin_edit/commit_edit checks.
+
2007-04-21 Derek Atkins <derek at ihtfp.com>
* Phil Longstaff's patch to fix a kvp_frame bug.
Modified: gnucash/branches/2.0/src/engine/Account.c
===================================================================
--- gnucash/branches/2.0/src/engine/Account.c 2007-04-21 19:18:19 UTC (rev 15960)
+++ gnucash/branches/2.0/src/engine/Account.c 2007-04-21 19:18:44 UTC (rev 15961)
@@ -1168,9 +1168,11 @@
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);
}
Modified: gnucash/branches/2.0/src/engine/gnc-budget.c
===================================================================
--- gnucash/branches/2.0/src/engine/gnc-budget.c 2007-04-21 19:18:19 UTC (rev 15960)
+++ gnucash/branches/2.0/src/engine/gnc-budget.c 2007-04-21 19:18:44 UTC (rev 15961)
@@ -74,13 +74,13 @@
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;
@@ -103,9 +103,11 @@
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.entity, QOF_EVENT_CREATE , NULL);
Modified: gnucash/branches/2.0/src/engine/gnc-budget.h
===================================================================
--- gnucash/branches/2.0/src/engine/gnc-budget.h 2007-04-21 19:18:19 UTC (rev 15960)
+++ gnucash/branches/2.0/src/engine/gnc-budget.h 2007-04-21 19:18:44 UTC (rev 15961)
@@ -88,6 +88,9 @@
/** 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_entity_get_guid(QOF_ENTITY(X))) : *(guid_null()))
More information about the gnucash-changes
mailing list