diff options
author | Andrew Chow <achow101@gmail.com> | 2016-08-08 14:17:23 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2016-09-13 11:39:08 +0200 |
commit | a37cec537b70254a5587dd2aee6cfaad46349bcf (patch) | |
tree | 02e7e64d9eef3cffd68656d8ea5c34fedcce23b9 /src/qt/optionsmodel.cpp | |
parent | d9f0d4e0737a1f29173ee5407ba701496ba9f46b (diff) | |
download | bitcoin-a37cec537b70254a5587dd2aee6cfaad46349bcf.tar.xz |
Persist the datadir after option reset
Github-Pull: #8487
Rebased-From: 15df3c196b2359505980a2b0217133e0bb550565 57acb82e7014f3214229349485fa3f57842b10ae
Diffstat (limited to 'src/qt/optionsmodel.cpp')
-rw-r--r-- | src/qt/optionsmodel.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 684db71a8c..5538a28413 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -16,6 +16,7 @@ #include "main.h" // For DEFAULT_SCRIPTCHECK_THREADS #include "net.h" #include "txdb.h" // for -dbcache defaults +#include "intro.h" #ifdef ENABLE_WALLET #include "wallet/wallet.h" @@ -98,6 +99,9 @@ void OptionsModel::Init(bool resetSettings) if (!SoftSetArg("-par", settings.value("nThreadsScriptVerif").toString().toStdString())) addOverriddenOption("-par"); + if (!settings.contains("strDataDir")) + settings.setValue("strDataDir", Intro::getDefaultDataDirectory()); + // Wallet #ifdef ENABLE_WALLET if (!settings.contains("bSpendZeroConfChange")) @@ -150,9 +154,19 @@ void OptionsModel::Reset() { QSettings settings; + // Save the strDataDir setting + QString dataDir = Intro::getDefaultDataDirectory(); + dataDir = settings.value("strDataDir", dataDir).toString(); + // Remove all entries from our QSettings object settings.clear(); + // Set strDataDir + settings.setValue("strDataDir", dataDir); + + // Set that this was reset + settings.setValue("fReset", true); + // default setting for OptionsModel::StartAtStartup - disabled if (GUIUtil::GetStartOnSystemStartup()) GUIUtil::SetStartOnSystemStartup(false); |