summaryrefslogtreecommitdiffstats
path: root/kmymoney2/views/kinstitutionsview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmymoney2/views/kinstitutionsview.cpp')
-rw-r--r--kmymoney2/views/kinstitutionsview.cpp11
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;