Commit 1d83652c authored by Thomas Baumgart's avatar Thomas Baumgart
Browse files

Harmonize display of closed accounts in home view

Different sections of the home view displayed closed accounts depending
of the "Show all accounts" and "Do not show closed accounts"
differently. The handling has been harmonized such that closed accounts
will be displayed in all sections alike either if "Show all accounts" is
active or "Don't show closed accounts" is inactive.

Closed accounts will also be shown in strike-through so that they can
easily be identified as closed.

BUG: 424098

(cherry picked from commit 6e078d95)
parent 2731fc0e
......@@ -217,8 +217,15 @@ public:
tmp = QString("<td class=\"center\">%1</td>").arg(cellStatus);
}
tmp += QString("<td>") +
link(VIEW_LEDGER, QString("?id=%1").arg(acc.id())) + acc.name() + linkend() + "</td>";
tmp += QString("<td>") + link(VIEW_LEDGER, QString("?id=%1").arg(acc.id()));
if (acc.isClosed()) {
tmp += QLatin1String("<strike>");
}
tmp += acc.name();
if (acc.isClosed()) {
tmp += QLatin1String("</strike>");
}
tmp += linkend() + "</td>";
int countNotMarked = 0, countCleared = 0, countNotReconciled = 0;
QString countStr;
......@@ -848,7 +855,7 @@ public:
int prec = MyMoneyMoney::denomToPrec(file->baseCurrency().smallestAccountFraction());
QList<MyMoneyAccount> accounts;
auto showClosedAccounts = KMyMoneySettings::showAllAccounts();
const auto showClosedAccounts = !KMyMoneySettings::hideClosedAccounts() || KMyMoneySettings::showAllAccounts();
// get list of all accounts
file->accountList(accounts);
......@@ -1202,8 +1209,10 @@ public:
// get list of all accounts
file->accountList(accounts);
const auto showClosedAccounts = !KMyMoneySettings::hideClosedAccounts() || KMyMoneySettings::showAllAccounts();
for (it = accounts.constBegin(); it != accounts.constEnd();) {
if (!(*it).isClosed()) {
if (!(*it).isClosed() || showClosedAccounts) {
switch ((*it).accountType()) {
// group all assets into one list but make sure that investment accounts always show up
case Account::Type::Investment:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment