Merge pull request #1352 from namecheap/bugfix/nc_shortcuts-reset
Bugfix/nc shortcuts reset
This commit is contained in:
@@ -168,7 +168,7 @@ void GeneralConf::resetConfiguration()
|
||||
if (reply == QMessageBox::Yes) {
|
||||
m_savePath->setText(
|
||||
QStandardPaths::writableLocation(QStandardPaths::PicturesLocation));
|
||||
ConfigHandler().setDefaults();
|
||||
ConfigHandler().setDefaultSettings();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,9 +23,11 @@
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QKeySequence>
|
||||
#include <QProcess>
|
||||
#include <QStandardPaths>
|
||||
#include <algorithm>
|
||||
#if defined(Q_OS_MACOS)
|
||||
#include <QProcess>
|
||||
#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()
|
||||
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
bool useJpgForClipboard() const;
|
||||
void setUseJpgForClipboard(const bool);
|
||||
|
||||
void setDefaults();
|
||||
void setDefaultSettings();
|
||||
void setAllTheButtons();
|
||||
|
||||
void setIgnoreUpdateToVersion(const QString& text);
|
||||
|
||||
Reference in New Issue
Block a user