git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3704 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas
2001-02-27 03:09:36 +00:00
parent 807e2b207a
commit 5bd3867fef

View File

@@ -610,7 +610,7 @@ xaccAccountInsertSubAccount (Account *adult, Account *child)
\********************************************************************/ \********************************************************************/
static int static int
group_insert_helper (gconstpointer a, gconstpointer b) group_sort_helper (gconstpointer a, gconstpointer b)
{ {
Account *aa = (Account *) a; Account *aa = (Account *) a;
Account *bb = (Account *) b; Account *bb = (Account *) b;
@@ -629,17 +629,24 @@ xaccGroupInsertAccount (AccountGroup *grp, Account *acc)
* first. Basically, we can't have accounts being in two places at * first. Basically, we can't have accounts being in two places at
* once. If old and new parents are the same, reinsertion causes * once. If old and new parents are the same, reinsertion causes
* the sort order to be checked. */ * the sort order to be checked. */
if (acc->parent) if (acc->parent == grp)
xaccRemoveAccount (acc); {
grp->accounts = g_list_sort (grp->accounts, group_sort_helper);
}
else
{
if (acc->parent)
xaccRemoveAccount (acc);
/* set back-pointer to the account's parent */
acc->parent = grp;
grp->accounts = g_list_insert_sorted (grp->accounts, acc,
group_sort_helper);
}
grp->saved = 0; grp->saved = 0;
/* set back-pointer to the account's parent */
acc->parent = grp;
grp->accounts = g_list_insert_sorted (grp->accounts, acc,
group_insert_helper);
gnc_engine_generate_event (&acc->guid, GNC_EVENT_MODIFY); gnc_engine_generate_event (&acc->guid, GNC_EVENT_MODIFY);
} }