Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/reports/pivottable.cpp
Show First 20 Lines • Show All 2293 Lines • ▼ Show 20 Line(s) | |||||
2294 | void PivotTable::includeInvestmentSubAccounts() | 2294 | void PivotTable::includeInvestmentSubAccounts() | ||
2295 | { | 2295 | { | ||
2296 | // if we're not in expert mode, we need to make sure | 2296 | // if we're not in expert mode, we need to make sure | ||
2297 | // that all stock accounts for the selected investment | 2297 | // that all stock accounts for the selected investment | ||
2298 | // account are also selected | 2298 | // account are also selected | ||
2299 | QStringList accountList; | 2299 | QStringList accountList; | ||
2300 | if (m_config.accounts(accountList)) { | 2300 | if (m_config.accounts(accountList)) { | ||
2301 | if (!KMyMoneyGlobalSettings::expertMode()) { | 2301 | if (!KMyMoneyGlobalSettings::expertMode()) { | ||
2302 | QStringList::const_iterator it_a, it_b; | 2302 | foreach (const auto sAccount, accountList) { | ||
2303 | for (it_a = accountList.constBegin(); it_a != accountList.constEnd(); ++it_a) { | 2303 | auto acc = MyMoneyFile::instance()->account(sAccount); | ||
2304 | MyMoneyAccount acc = MyMoneyFile::instance()->account(*it_a); | | |||
2305 | if (acc.accountType() == eMyMoney::Account::Type::Investment) { | 2304 | if (acc.accountType() == eMyMoney::Account::Type::Investment) { | ||
2306 | for (it_b = acc.accountList().constBegin(); it_b != acc.accountList().constEnd(); ++it_b) { | 2305 | foreach (const auto sSubAccount, acc.accountList()) { | ||
2307 | if (!accountList.contains(*it_b)) { | 2306 | if (!accountList.contains(sSubAccount)) { | ||
2308 | m_config.addAccount(*it_b); | 2307 | m_config.addAccount(sSubAccount); | ||
2309 | } | 2308 | } | ||
2310 | } | 2309 | } | ||
2311 | } | 2310 | } | ||
2312 | } | 2311 | } | ||
2313 | } | 2312 | } | ||
2314 | } | 2313 | } | ||
2315 | } | 2314 | } | ||
2316 | 2315 | | |||
Show All 27 Lines |