[office/kmymoney/5.1] /: Remove hide closed accounts option from config
Thomas Baumgart
null at kde.org
Mon Aug 16 12:56:39 BST 2021
Git commit 51a7a9f77cfaf8d5e9a1123dd2cf387064b9ea3e by Thomas Baumgart.
Committed on 16/08/2021 at 11:56.
Pushed by tbaumgart into branch '5.1'.
Remove hide closed accounts option from config
(cherry picked from commit 445958f5b904db1d8a5a1d9623b082577bc5475a)
BUG: 223708
FIXED-IN: 5.1.3
M +0 -10 doc/details-settings.docbook
M +0 -12 kmymoney/dialogs/settings/ksettingsgeneral.ui
M +0 -4 kmymoney/settings/kmymoney.kcfg
M +7 -1 kmymoney/settings/kmymoney.upd
M +2 -2 kmymoney/views/kaccountsview.cpp
M +1 -1 kmymoney/views/kcategoriesview.cpp
M +1 -1 kmymoney/views/kgloballedgerview_p.h
M +4 -4 kmymoney/views/khomeview_p.h
M +1 -1 kmymoney/views/kinstitutionsview.cpp
M +2 -2 kmymoney/views/kinvestmentview_p.h
M +1 -1 kmymoney/widgets/ktransactionfilter_p.h
https://invent.kde.org/office/kmymoney/commit/51a7a9f77cfaf8d5e9a1123dd2cf387064b9ea3e
diff --git a/doc/details-settings.docbook b/doc/details-settings.docbook
index 546bb97de..94d17eff6 100644
--- a/doc/details-settings.docbook
+++ b/doc/details-settings.docbook
@@ -175,16 +175,6 @@
</listitem>
</varlistentry>
- <varlistentry>
- <term><guilabel>Do not show closed accounts</guilabel></term>
- <listitem>
- <para>Checking this box hides closed accounts from display in the Accounts,
- Ledger, and Investment Views. Hiding closed accounts makes viewing and working
- with open accounts easier. Unchecking this box will show closed accounts with
- a line drawn through them allowing viewing and reopening if needed.</para>
- </listitem>
- </varlistentry>
-
<varlistentry>
<term><guilabel>Show equity accounts</guilabel></term>
<listitem>
diff --git a/kmymoney/dialogs/settings/ksettingsgeneral.ui b/kmymoney/dialogs/settings/ksettingsgeneral.ui
index e71a5b04c..eacb15397 100644
--- a/kmymoney/dialogs/settings/ksettingsgeneral.ui
+++ b/kmymoney/dialogs/settings/ksettingsgeneral.ui
@@ -417,18 +417,6 @@ Set it to 0 to turn the feature off.</string>
</property>
</widget>
</item>
- <item>
- <widget class="QCheckBox" name="kcfg_HideClosedAccounts">
- <property name="whatsThis">
- <string>This option hides all accounts that have been closed by the user in views and selection lists.
-
-You can use <b>View/Show all accounts</b> to temporarily show hidden accounts in the views.</string>
- </property>
- <property name="text">
- <string>Do not show closed accounts</string>
- </property>
- </widget>
- </item>
<item>
<widget class="QCheckBox" name="kcfg_ExpertMode">
<property name="text">
diff --git a/kmymoney/settings/kmymoney.kcfg b/kmymoney/settings/kmymoney.kcfg
index e491187de..4d5340310 100644
--- a/kmymoney/settings/kmymoney.kcfg
+++ b/kmymoney/settings/kmymoney.kcfg
@@ -228,10 +228,6 @@
<label>Hide unused categories</label>
<default>false</default>
</entry>
- <entry name="HideClosedAccounts" type="Bool">
- <label>Hide closed accounts</label>
- <default>false</default>
- </entry>
<entry name="ShowAllAccounts" type="Bool">
<label>Show all accounts</label>
<default>false</default>
diff --git a/kmymoney/settings/kmymoney.upd b/kmymoney/settings/kmymoney.upd
index d55becd02..5c7d35a08 100644
--- a/kmymoney/settings/kmymoney.upd
+++ b/kmymoney/settings/kmymoney.upd
@@ -1,4 +1,10 @@
+Version=5
Id=1
-File=kmymoneyrc
+File=kmymoney/kmymoneyrc
Group=List Options
Key=listErronousTransactionColor,listErroneousTransactionColor
+
+Id=remove-hide-acc-opt-2021
+File=kmymoney/kmymoneyrc
+Group=List Options
+RemoveKey=HideClosedAccounts
diff --git a/kmymoney/views/kaccountsview.cpp b/kmymoney/views/kaccountsview.cpp
index 602cdb9af..1bfe260d7 100644
--- a/kmymoney/views/kaccountsview.cpp
+++ b/kmymoney/views/kaccountsview.cpp
@@ -82,7 +82,7 @@ void KAccountsView::refresh()
d->m_needsRefresh = false;
// TODO: check why the invalidate is needed here
d->m_proxyModel->invalidate();
- d->m_proxyModel->setHideClosedAccounts(KMyMoneySettings::hideClosedAccounts() && !KMyMoneySettings::showAllAccounts());
+ d->m_proxyModel->setHideClosedAccounts(!KMyMoneySettings::showAllAccounts());
d->m_proxyModel->setHideEquityAccounts(!KMyMoneySettings::expertMode());
if (KMyMoneySettings::showCategoriesInAccountsView()) {
d->m_proxyModel->addAccountGroup(QVector<eMyMoney::Account::Type> {eMyMoney::Account::Type::Income, eMyMoney::Account::Type::Expense});
@@ -348,7 +348,7 @@ void KAccountsView::slotCloseAccount()
MyMoneyFile::instance()->modifyAccount(d->m_currentAccount);
emit selectByObject(d->m_currentAccount, eView::Intent::None);
ft.commit();
- if (KMyMoneySettings::hideClosedAccounts())
+ if (!KMyMoneySettings::showAllAccounts())
KMessageBox::information(this, i18n("<qt>You have closed this account. It remains in the system because you have transactions which still refer to it, but it is not shown in the views. You can make it visible again by going to the View menu and selecting <b>Show all accounts</b> or by deselecting the <b>Do not show closed accounts</b> setting.</qt>"), i18n("Information"), "CloseAccountInfo");
} catch (const MyMoneyException &) {
}
diff --git a/kmymoney/views/kcategoriesview.cpp b/kmymoney/views/kcategoriesview.cpp
index 506283172..07a32389b 100644
--- a/kmymoney/views/kcategoriesview.cpp
+++ b/kmymoney/views/kcategoriesview.cpp
@@ -84,7 +84,7 @@ void KCategoriesView::refresh()
d->m_needsRefresh = false;
d->m_proxyModel->invalidate();
- d->m_proxyModel->setHideClosedAccounts(KMyMoneySettings::hideClosedAccounts() && !KMyMoneySettings::showAllAccounts());
+ d->m_proxyModel->setHideClosedAccounts(!KMyMoneySettings::showAllAccounts());
// reinitialize the default state of the hidden categories label
d->m_haveUnusedCategories = false;
diff --git a/kmymoney/views/kgloballedgerview_p.h b/kmymoney/views/kgloballedgerview_p.h
index 5db6c0912..5d93045a7 100644
--- a/kmymoney/views/kgloballedgerview_p.h
+++ b/kmymoney/views/kgloballedgerview_p.h
@@ -413,7 +413,7 @@ public:
// TODO: check why the invalidate is needed here
m_filterProxyModel->invalidate();
m_filterProxyModel->sort((int)eAccountsModel::Column::Account);
- m_filterProxyModel->setHideClosedAccounts(KMyMoneySettings::hideClosedAccounts() && !KMyMoneySettings::showAllAccounts());
+ m_filterProxyModel->setHideClosedAccounts(!KMyMoneySettings::showAllAccounts());
m_filterProxyModel->setHideEquityAccounts(!KMyMoneySettings::expertMode());
m_accountComboBox->expandAll();
diff --git a/kmymoney/views/khomeview_p.h b/kmymoney/views/khomeview_p.h
index bebcc3a4a..41d65b845 100644
--- a/kmymoney/views/khomeview_p.h
+++ b/kmymoney/views/khomeview_p.h
@@ -847,13 +847,13 @@ public:
int prec = MyMoneyMoney::denomToPrec(file->baseCurrency().smallestAccountFraction());
QList<MyMoneyAccount> accounts;
- const auto showClosedAccounts = !KMyMoneySettings::hideClosedAccounts() || KMyMoneySettings::showAllAccounts();
+ const auto showAllAccounts = KMyMoneySettings::showAllAccounts();
// get list of all accounts
file->accountList(accounts);
for (QList<MyMoneyAccount>::Iterator it = accounts.begin(); it != accounts.end();) {
bool removeAccount = false;
- if (!(*it).isClosed() || showClosedAccounts) {
+ if (!(*it).isClosed() || showAllAccounts) {
switch ((*it).accountType()) {
case Account::Type::Expense:
case Account::Type::Income:
@@ -1204,10 +1204,10 @@ public:
// get list of all accounts
file->accountList(accounts);
- const auto showClosedAccounts = !KMyMoneySettings::hideClosedAccounts() || KMyMoneySettings::showAllAccounts();
+ const auto showAllAccounts = KMyMoneySettings::showAllAccounts();
for (it = accounts.constBegin(); it != accounts.constEnd();) {
- if (!(*it).isClosed() || showClosedAccounts) {
+ if (!(*it).isClosed() || showAllAccounts) {
switch ((*it).accountType()) {
// group all assets into one list but make sure that investment accounts always show up
case Account::Type::Investment:
diff --git a/kmymoney/views/kinstitutionsview.cpp b/kmymoney/views/kinstitutionsview.cpp
index 3b7423dfb..f42d916c7 100644
--- a/kmymoney/views/kinstitutionsview.cpp
+++ b/kmymoney/views/kinstitutionsview.cpp
@@ -76,7 +76,7 @@ void KInstitutionsView::refresh()
d->m_proxyModel->invalidate();
d->m_proxyModel->setHideEquityAccounts(!KMyMoneySettings::expertMode());
- d->m_proxyModel->setHideClosedAccounts(KMyMoneySettings::hideClosedAccounts() && !KMyMoneySettings::showAllAccounts());
+ d->m_proxyModel->setHideClosedAccounts(!KMyMoneySettings::showAllAccounts());
}
void KInstitutionsView::showEvent(QShowEvent * event)
diff --git a/kmymoney/views/kinvestmentview_p.h b/kmymoney/views/kinvestmentview_p.h
index 62aae21d0..49dd3d1f0 100644
--- a/kmymoney/views/kinvestmentview_p.h
+++ b/kmymoney/views/kinvestmentview_p.h
@@ -166,11 +166,11 @@ public:
void loadInvestmentTab()
{
Q_Q(KInvestmentView);
- m_equitiesProxyModel->setHideClosedAccounts(KMyMoneySettings::hideClosedAccounts() && !KMyMoneySettings::showAllAccounts());
+ m_equitiesProxyModel->setHideClosedAccounts(!KMyMoneySettings::showAllAccounts());
m_equitiesProxyModel->setHideZeroBalanceAccounts(KMyMoneySettings::hideZeroBalanceEquities());
m_equitiesProxyModel->invalidate();
- m_accountsProxyModel->setHideClosedAccounts(KMyMoneySettings::hideClosedAccounts() && !KMyMoneySettings::showAllAccounts());
+ m_accountsProxyModel->setHideClosedAccounts(!KMyMoneySettings::showAllAccounts());
m_accountsProxyModel->invalidate();
if (!m_idInvAcc.isEmpty()) { // check if account to be selected exist
diff --git a/kmymoney/widgets/ktransactionfilter_p.h b/kmymoney/widgets/ktransactionfilter_p.h
index 453a7e799..0b72e8d01 100644
--- a/kmymoney/widgets/ktransactionfilter_p.h
+++ b/kmymoney/widgets/ktransactionfilter_p.h
@@ -378,7 +378,7 @@ public:
accountSet.addAccountGroup(eMyMoney::Account::Type::Equity);
// set the accountset to show closed account if the settings say so
- accountSet.setHideClosedAccounts(KMyMoneySettings::hideClosedAccounts() && !KMyMoneySettings::showAllAccounts());
+ accountSet.setHideClosedAccounts(!KMyMoneySettings::showAllAccounts());
accountSet.setShowInvestments(withInvestments);
accountSet.load(ui->m_accountsView);
q->connect(ui->m_accountsView, &KMyMoneyAccountSelector::stateChanged, q, &KTransactionFilter::slotUpdateSelections);
More information about the kde-doc-english
mailing list