mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix bug loading example accounts into gui.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5462 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
6bb6d59903
commit
891ac0e2b6
@ -1187,8 +1187,6 @@ AccountGroup *
|
||||
xaccAccountGetChildren (Account *acc)
|
||||
{
|
||||
if (!acc) return NULL;
|
||||
if (acc->children == NULL)
|
||||
xaccAccountInsertSubAccount (acc, NULL);
|
||||
return (acc->children);
|
||||
}
|
||||
|
||||
|
@ -572,6 +572,7 @@ clone_account (const Account* from, gnc_commodity *com)
|
||||
struct add_group_data_struct
|
||||
{
|
||||
AccountGroup *to;
|
||||
Account *parent;
|
||||
gnc_commodity *com;
|
||||
};
|
||||
|
||||
@ -586,7 +587,15 @@ add_groups_for_each (Account *toadd, gpointer data)
|
||||
if (!foundact)
|
||||
{
|
||||
foundact = clone_account (toadd, dadata->com);
|
||||
|
||||
if (dadata->to)
|
||||
xaccGroupInsertAccount (dadata->to, foundact);
|
||||
else if (dadata->parent)
|
||||
xaccAccountInsertSubAccount (dadata->parent, foundact);
|
||||
else
|
||||
{
|
||||
g_warning ("add_groups_for_each: no valid parent");
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
@ -597,6 +606,7 @@ add_groups_for_each (Account *toadd, gpointer data)
|
||||
struct add_group_data_struct downdata;
|
||||
|
||||
downdata.to = xaccAccountGetChildren(foundact);
|
||||
downdata.parent = foundact;
|
||||
downdata.com = dadata->com;
|
||||
|
||||
xaccGroupForEachAccount (addgrp, add_groups_for_each,
|
||||
@ -613,6 +623,7 @@ add_groups_to_with_random_guids (AccountGroup *into, AccountGroup *from,
|
||||
{
|
||||
struct add_group_data_struct data;
|
||||
data.to = into;
|
||||
data.parent = NULL;
|
||||
data.com = com;
|
||||
|
||||
xaccGroupForEachAccount (from, add_groups_for_each, &data, FALSE);
|
||||
|
Loading…
Reference in New Issue
Block a user