diff --git a/src/qt/dash.cpp b/src/qt/dash.cpp index 4b86ebbe25..342a950b7a 100644 --- a/src/qt/dash.cpp +++ b/src/qt/dash.cpp @@ -393,7 +393,7 @@ BitcoinApplication::~BitcoinApplication() #endif // Delete Qt-settings if user clicked on "Reset Options" QSettings settings; - if(optionsModel && optionsModel->resetSettings){ + if(optionsModel && optionsModel->resetSettingsOnShutdown){ settings.clear(); settings.sync(); } diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 66cac99ce5..f682fa1104 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -254,6 +254,7 @@ void OptionsDialog::on_resetButton_clicked() /* reset all options and close GUI */ model->Reset(); + model->resetSettingsOnShutdown = true; QApplication::quit(); } } diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 440c9d60a9..fc6a273289 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -52,8 +52,6 @@ void OptionsModel::Init(bool resetSettings) checkAndMigrate(); - this->resetSettings = resetSettings; - QSettings settings; // Ensure restart flag is unset on client startup @@ -226,7 +224,6 @@ void OptionsModel::Reset() // Remove all entries from our QSettings object settings.clear(); - resetSettings = true; // Needed in dash.cpp during shotdown to also remove the window positions // default setting for OptionsModel::StartAtStartup - disabled if (GUIUtil::GetStartOnSystemStartup()) diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index 01a7181dad..4afd3ab9fa 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -84,7 +84,7 @@ public: /* Restart flag helper */ void setRestartRequired(bool fRequired); bool isRestartRequired() const; - bool resetSettings; + bool resetSettingsOnShutdown{false}; private: /* Qt-only settings */