diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-01 21:14:05 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-01 21:14:05 -0500 |
commit | 6b6ca6d4c70df0e4a3009ee093cf2f83ecee2675 (patch) | |
tree | d883948c90dd7d6dd096458a96c6b3e2b66b312a /src/temps.cc | |
parent | 48f024a42aa02f36220cf5e06ed005c65cc3fa76 (diff) | |
download | fork-ledger-6b6ca6d4c70df0e4a3009ee093cf2f83ecee2675.tar.gz fork-ledger-6b6ca6d4c70df0e4a3009ee093cf2f83ecee2675.tar.bz2 fork-ledger-6b6ca6d4c70df0e4a3009ee093cf2f83ecee2675.zip |
Improved the way account temporaries are managed
Diffstat (limited to 'src/temps.cc')
-rw-r--r-- | src/temps.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/temps.cc b/src/temps.cc index f2dee159..e44aaaa7 100644 --- a/src/temps.cc +++ b/src/temps.cc @@ -48,6 +48,11 @@ temporaries_t::~temporaries_t() if (! post.account->has_flags(ACCOUNT_TEMP)) post.account->remove_post(&post); } + + foreach (account_t& acct, *acct_temps) { + if (! acct.has_flags(ACCOUNT_TEMP)) + acct.remove_account(&acct); + } } } @@ -120,6 +125,9 @@ account_t& temporaries_t::create_account(const string& name, acct_temps->push_back(account_t(parent, name)); account_t& temp(acct_temps->back()); + if (parent) + parent->add_account(&temp); + temp.add_flags(ACCOUNT_TEMP); return temp; } |