Fix -resetguisettings (#3624)

This commit is contained in:
UdjinM6 2020-07-27 10:33:00 +03:00 committed by pasta
parent 508fc2db4b
commit 8d99e7836c
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984
4 changed files with 3 additions and 5 deletions

View File

@ -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();
}

View File

@ -254,6 +254,7 @@ void OptionsDialog::on_resetButton_clicked()
/* reset all options and close GUI */
model->Reset();
model->resetSettingsOnShutdown = true;
QApplication::quit();
}
}

View File

@ -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())

View File

@ -84,7 +84,7 @@ public:
/* Restart flag helper */
void setRestartRequired(bool fRequired);
bool isRestartRequired() const;
bool resetSettings;
bool resetSettingsOnShutdown{false};
private:
/* Qt-only settings */