[Gnucash-changes] * src/engine/Account.c: - updated implementation
of
Derek Atkins
warlord at cvs.gnucash.org
Sun Jan 30 17:45:28 EST 2005
Log Message:
-----------
* src/engine/Account.c:
- updated implementation of qofAccountSetParent().
Modified Files:
--------------
gnucash:
ChangeLog
gnucash/src/engine:
Account.c
Revision Data
-------------
Index: ChangeLog
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/ChangeLog,v
retrieving revision 1.1885
retrieving revision 1.1886
diff -LChangeLog -LChangeLog -u -r1.1885 -r1.1886
--- ChangeLog
+++ ChangeLog
@@ -13,6 +13,9 @@
compatible with QSF: using false instead of FALSE in string
output and using the QSF_XSD_TIME for the datestrings.
+ * src/engine/Account.c:
+ - updated implementation of qofAccountSetParent().
+
2005-01-29 Derek Atkins <derek at ihtfp.com>
David Montenegro's patch for bugs #95551, #124367.
Index: Account.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/Account.c,v
retrieving revision 1.281
retrieving revision 1.282
diff -Lsrc/engine/Account.c -Lsrc/engine/Account.c -u -r1.281 -r1.282
--- src/engine/Account.c
+++ src/engine/Account.c
@@ -1258,23 +1258,17 @@
static void
qofAccountSetParent (Account *acc, QofEntity *parent)
{
- AccountGroup *ag;
- if((!acc)||(!parent)) return;
- if(acc->parent) return;
+ Account *parent_acc;
+
+ if((!acc)||(!parent)) { return; }
+ parent_acc = (Account*)parent;
xaccAccountBeginEdit(acc);
- g_message("qofAccountSetParent start");
- ag = xaccAccountGetParent((Account*)parent);
- acc->parent = ag;
-/* FIXME: acc->parent is type AccountGroup but AccountGroup is not a true QOF object
-so can't set AccountGroup in the target book because the GUID of any new AccountGroups
-is not found. Workaround uses Account as the reference type.
- */
- if(!acc->parent) {
- g_message("qofAccountSetParent failed.");
- }
+ xaccAccountBeginEdit(parent_acc);
+ xaccAccountInsertSubAccount(parent_acc, acc);
+ mark_account (parent_acc);
mark_account (acc);
- acc->inst.dirty = TRUE;
xaccAccountCommitEdit(acc);
+ xaccAccountCommitEdit(parent_acc);
}
void
More information about the gnucash-changes
mailing list