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 #endif
// Delete Qt-settings if user clicked on "Reset Options" // Delete Qt-settings if user clicked on "Reset Options"
QSettings settings; QSettings settings;
if(optionsModel && optionsModel->resetSettings){ if(optionsModel && optionsModel->resetSettingsOnShutdown){
settings.clear(); settings.clear();
settings.sync(); settings.sync();
} }

View File

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

View File

@ -52,8 +52,6 @@ void OptionsModel::Init(bool resetSettings)
checkAndMigrate(); checkAndMigrate();
this->resetSettings = resetSettings;
QSettings settings; QSettings settings;
// Ensure restart flag is unset on client startup // Ensure restart flag is unset on client startup
@ -226,7 +224,6 @@ void OptionsModel::Reset()
// Remove all entries from our QSettings object // Remove all entries from our QSettings object
settings.clear(); settings.clear();
resetSettings = true; // Needed in dash.cpp during shotdown to also remove the window positions
// default setting for OptionsModel::StartAtStartup - disabled // default setting for OptionsModel::StartAtStartup - disabled
if (GUIUtil::GetStartOnSystemStartup()) if (GUIUtil::GetStartOnSystemStartup())

View File

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