diff options
author | Jonas Schnelli <dev@jonasschnelli.ch> | 2016-08-25 11:42:45 +0200 |
---|---|---|
committer | Jonas Schnelli <dev@jonasschnelli.ch> | 2016-08-25 11:42:57 +0200 |
commit | d26234a9e2fa93c5340330a9de612555fc329620 (patch) | |
tree | 8e44777bddc1b9a3f022991e59fb61ab1b2965b1 /src/qt/optionsmodel.cpp | |
parent | 95a983d56dbda457e3bf8766d59bac74c7aa5699 (diff) | |
parent | 57acb82e7014f3214229349485fa3f57842b10ae (diff) |
Merge #8487: Persist the datadir after option reset
57acb82 Load choose datadir dialog after options reset (Andrew Chow)
15df3c1 Persist the datadir after option reset (Andrew Chow)
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 d33ab68277..f82e153b67 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -17,6 +17,7 @@ #include "net.h" #include "netbase.h" #include "txdb.h" // for -dbcache defaults +#include "intro.h" #ifdef ENABLE_WALLET #include "wallet/wallet.h" @@ -99,6 +100,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")) @@ -151,9 +155,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); |