summaryrefslogtreecommitdiffstats
path: root/kmymoney2/views
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-01-14 14:08:52 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-01-14 14:08:52 -0600
commit8654cea10f6902719006d5975db7dc07b2fcc713 (patch)
tree6cf0608a089c234056746a467f739722687b645a /kmymoney2/views
parent2a54aa58cfe166f48d6f1395cbc6c9bfd5e31bfc (diff)
downloadkmymoney-8654cea10f6902719006d5975db7dc07b2fcc713.tar.gz
kmymoney-8654cea10f6902719006d5975db7dc07b2fcc713.zip
Update to upstream stable version 1.0.5
Diffstat (limited to 'kmymoney2/views')
-rw-r--r--kmymoney2/views/kgloballedgerview.cpp7
-rw-r--r--kmymoney2/views/khomeview.cpp7
-rw-r--r--kmymoney2/views/kinstitutionsview.cpp11
3 files changed, 22 insertions, 3 deletions
diff --git a/kmymoney2/views/kgloballedgerview.cpp b/kmymoney2/views/kgloballedgerview.cpp
index 8209d3f..e82459a 100644
--- a/kmymoney2/views/kgloballedgerview.cpp
+++ b/kmymoney2/views/kgloballedgerview.cpp
@@ -485,7 +485,12 @@ void KGlobalLedgerView::loadView(void)
break;
// for all others, we check if the next payment date is still 'in range'
- s.setNextDueDate(s.nextPayment(s.nextDueDate()));
+ TQDate nextDueDate = s.nextPayment(s.nextDueDate());
+ if (nextDueDate.isValid()) {
+ s.setNextDueDate(nextDueDate);
+ } else {
+ break;
+ }
}
scheduleList.pop_front();
}
diff --git a/kmymoney2/views/khomeview.cpp b/kmymoney2/views/khomeview.cpp
index 60bb173..8745d64 100644
--- a/kmymoney2/views/khomeview.cpp
+++ b/kmymoney2/views/khomeview.cpp
@@ -595,6 +595,13 @@ void KHomeView::showPayments(void)
schedule.remove(it);
continue;
}
+
+ //if nextPayment returns an invalid date, setNextDueDate will just skip it, resulting in a loop
+ //we check the resulting date and erase the schedule if invalid
+ if(!((*it).nextPayment((*it).nextDueDate())).isValid()) {
+ schedule.remove(it);
+ continue;
+ }
(*it).setNextDueDate((*it).nextPayment((*it).nextDueDate()));
qBubbleSort(schedule);
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;