|
Rex Dieter |
8d984d2 |
From ff5ec06b2eee8b367a2bbd2a50f5c04de7fa45ee Mon Sep 17 00:00:00 2001
|
|
Rex Dieter |
8d984d2 |
From: =?UTF-8?q?Cristian=20One=C8=9B?= <onet.cristian@gmail.com>
|
|
Rex Dieter |
8d984d2 |
Date: Fri, 16 Nov 2012 08:49:18 +0200
|
|
Rex Dieter |
8d984d2 |
Subject: [PATCH 03/22] Only load the child accounts if there are any,
|
|
Rex Dieter |
8d984d2 |
otherwise MyMoneyFile::accountList will return all accounts.
|
|
Rex Dieter |
8d984d2 |
|
|
Rex Dieter |
8d984d2 |
BUG: 309105
|
|
Rex Dieter |
8d984d2 |
(cherry picked from commit e492b20918f569e218b65925b7f758aeef01d865)
|
|
Rex Dieter |
8d984d2 |
---
|
|
Rex Dieter |
8d984d2 |
kmymoney/models/accountsmodel.cpp | 12 +++++++-----
|
|
Rex Dieter |
8d984d2 |
1 file changed, 7 insertions(+), 5 deletions(-)
|
|
Rex Dieter |
8d984d2 |
|
|
Rex Dieter |
8d984d2 |
diff --git a/kmymoney/models/accountsmodel.cpp b/kmymoney/models/accountsmodel.cpp
|
|
Rex Dieter |
8d984d2 |
index 37816f5..3679314 100644
|
|
Rex Dieter |
8d984d2 |
--- a/kmymoney/models/accountsmodel.cpp
|
|
Rex Dieter |
8d984d2 |
+++ b/kmymoney/models/accountsmodel.cpp
|
|
Rex Dieter |
8d984d2 |
@@ -884,11 +884,13 @@ void InstitutionsModel::slotObjectAdded(MyMoneyFile::notificationObjectT objType
|
|
Rex Dieter |
8d984d2 |
|
|
Rex Dieter |
8d984d2 |
// load the investment sub-accounts if there are any - there could be sub-accounts if this is an add operation
|
|
Rex Dieter |
8d984d2 |
// that was triggered in slotObjectModified on an already existing account which went trough a hierarchy change
|
|
Rex Dieter |
8d984d2 |
- QList<MyMoneyAccount> subAccounts;
|
|
Rex Dieter |
8d984d2 |
- d->m_file->accountList(subAccounts, account->accountList(), true);
|
|
Rex Dieter |
8d984d2 |
- for (QList<MyMoneyAccount>::ConstIterator it_a = subAccounts.constBegin(); it_a != subAccounts.constEnd(); ++it_a) {
|
|
Rex Dieter |
8d984d2 |
- if ((*it_a).isInvest()) {
|
|
Rex Dieter |
8d984d2 |
- static_cast<InstitutionsPrivate *>(d)->loadInstitution(this, *it_a);
|
|
Rex Dieter |
8d984d2 |
+ if (!account->accountList().isEmpty()) {
|
|
Rex Dieter |
8d984d2 |
+ QList<MyMoneyAccount> subAccounts;
|
|
Rex Dieter |
8d984d2 |
+ d->m_file->accountList(subAccounts, account->accountList());
|
|
Rex Dieter |
8d984d2 |
+ for (QList<MyMoneyAccount>::ConstIterator it_a = subAccounts.constBegin(); it_a != subAccounts.constEnd(); ++it_a) {
|
|
Rex Dieter |
8d984d2 |
+ if ((*it_a).isInvest()) {
|
|
Rex Dieter |
8d984d2 |
+ static_cast<InstitutionsPrivate *>(d)->loadInstitution(this, *it_a);
|
|
Rex Dieter |
8d984d2 |
+ }
|
|
Rex Dieter |
8d984d2 |
}
|
|
Rex Dieter |
8d984d2 |
}
|
|
Rex Dieter |
8d984d2 |
}
|
|
Rex Dieter |
8d984d2 |
--
|
|
Rex Dieter |
8d984d2 |
1.8.1.4
|
|
Rex Dieter |
8d984d2 |
|