diff options
author | Timothy Pearson <[email protected]> | 2012-01-14 14:08:52 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2012-01-14 14:08:52 -0600 |
commit | 8654cea10f6902719006d5975db7dc07b2fcc713 (patch) | |
tree | 6cf0608a089c234056746a467f739722687b645a /kmymoney2/views/kinstitutionsview.cpp | |
parent | 2a54aa58cfe166f48d6f1395cbc6c9bfd5e31bfc (diff) | |
download | kmymoney-8654cea10f6902719006d5975db7dc07b2fcc713.tar.gz kmymoney-8654cea10f6902719006d5975db7dc07b2fcc713.zip |
Update to upstream stable version 1.0.5
Diffstat (limited to 'kmymoney2/views/kinstitutionsview.cpp')
-rw-r--r-- | kmymoney2/views/kinstitutionsview.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/kmymoney2/views/kinstitutionsview.cpp b/kmymoney2/views/kinstitutionsview.cpp index 0b9258f..87c0fc1 100644 --- a/kmymoney2/views/kinstitutionsview.cpp +++ b/kmymoney2/views/kinstitutionsview.cpp @@ -161,6 +161,9 @@ void KInstitutionsView::loadAccounts(void) // hide it, if unused noInstitutionItem->setVisible(noInstitutionItem->childCount() != 0); + + bool showClosedAccounts = kmymoney2->toggleAction("view_show_all_accounts")->isChecked() + || !KMyMoneyGlobalSettings::hideClosedAccounts(); TQValueList<MyMoneyInstitution> list = file->institutionList(); TQValueList<MyMoneyInstitution>::const_iterator it_i; @@ -168,6 +171,8 @@ void KInstitutionsView::loadAccounts(void) KMyMoneyAccountTreeItem* item = new KMyMoneyAccountTreeItem(m_accountTree, *it_i); item->setPixmap(0, none.pixmap()); loadSubAccounts(item, (*it_i).id()); + if(!showClosedAccounts) + item->setVisible(item->childCount() != 0); } } catch(MyMoneyException *e) { @@ -201,7 +206,8 @@ void KInstitutionsView::loadAccounts(void) void KInstitutionsView::loadSubAccounts(KMyMoneyAccountTreeItem* parent) { - bool showClosedAccounts = kmymoney2->toggleAction("view_show_all_accounts")->isChecked(); + bool showClosedAccounts = kmymoney2->toggleAction("view_show_all_accounts")->isChecked() + || !KMyMoneyGlobalSettings::hideClosedAccounts(); const MyMoneyAccount& account = dynamic_cast<const MyMoneyAccount&>(parent->itemObject()); TQValueList<TQString>::const_iterator it_a; MyMoneyFile* file = MyMoneyFile::instance(); @@ -230,7 +236,8 @@ void KInstitutionsView::loadSubAccounts(KMyMoneyAccountTreeItem* parent, const T TQMap<TQString, MyMoneyAccount>::const_iterator it_a; MyMoneyMoney value; - bool showClosedAccounts = kmymoney2->toggleAction("view_show_all_accounts")->isChecked(); + bool showClosedAccounts = kmymoney2->toggleAction("view_show_all_accounts")->isChecked() + || !KMyMoneyGlobalSettings::hideClosedAccounts(); for(it_a = m_accountMap.begin(); it_a != m_accountMap.end(); ++it_a) { const MyMoneyAccount& acc = *it_a; |