diff --git a/ChangeLog b/ChangeLog index b11d63bf32..87c5764c5c 100644 --- a/ChangeLog +++ b/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 David Montenegro's patch for bugs #95551, #124367. diff --git a/src/engine/Account.c b/src/engine/Account.c index 185f6fea25..b69ffc5f0e 100644 --- a/src/engine/Account.c +++ b/src/engine/Account.c @@ -1258,23 +1258,17 @@ xaccAccountSetDescription (Account *acc, const char *str) 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