From 757ca29a85cda18948be13b66b0d1940c4ae66e6 Mon Sep 17 00:00:00 2001 From: Yuriy Puchkov Date: Thu, 18 Feb 2021 16:44:02 +0200 Subject: [PATCH 1/2] fix - Reset configuration in the General tab resets general settings only (cherry picked from commit 59c84bb57bbf6c4e663662ca6e2f18eabe019f4e) # Conflicts: # src/utils/confighandler.cpp --- src/utils/confighandler.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/utils/confighandler.cpp b/src/utils/confighandler.cpp index 18095571..279824a2 100644 --- a/src/utils/confighandler.cpp +++ b/src/utils/confighandler.cpp @@ -23,9 +23,11 @@ #include #include #include -#include #include #include +#if defined(Q_OS_MACOS) +#include +#endif ConfigHandler::ConfigHandler() { @@ -546,9 +548,16 @@ void ConfigHandler::setUseJpgForClipboard(const bool value) m_settings.setValue(QStringLiteral("useJpgForClipboard"), value); } -void ConfigHandler::setDefaults() +void ConfigHandler::setDefaultSettings() { - m_settings.clear(); + foreach (const QString& key, m_settings.allKeys()) { + if (key.startsWith("Shortcuts/")) { + // Do not reset Shortcuts + continue; + } + m_settings.remove(key); + } + m_settings.sync(); } void ConfigHandler::setAllTheButtons() From d3e6191bb548f4fd262e52326f5e8dbfc25b83ee Mon Sep 17 00:00:00 2001 From: Yuriy Puchkov Date: Thu, 18 Feb 2021 13:20:33 +0200 Subject: [PATCH 2/2] fix - Reset configuration in the General tab resets general settings only (cherry picked from commit 59c84bb57bbf6c4e663662ca6e2f18eabe019f4e) --- src/config/generalconf.cpp | 2 +- src/utils/confighandler.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config/generalconf.cpp b/src/config/generalconf.cpp index cff92233..12f13281 100644 --- a/src/config/generalconf.cpp +++ b/src/config/generalconf.cpp @@ -168,7 +168,7 @@ void GeneralConf::resetConfiguration() if (reply == QMessageBox::Yes) { m_savePath->setText( QStandardPaths::writableLocation(QStandardPaths::PicturesLocation)); - ConfigHandler().setDefaults(); + ConfigHandler().setDefaultSettings(); } } diff --git a/src/utils/confighandler.h b/src/utils/confighandler.h index 3e318f54..4448b28a 100644 --- a/src/utils/confighandler.h +++ b/src/utils/confighandler.h @@ -96,7 +96,7 @@ public: bool useJpgForClipboard() const; void setUseJpgForClipboard(const bool); - void setDefaults(); + void setDefaultSettings(); void setAllTheButtons(); void setIgnoreUpdateToVersion(const QString& text);