Browse Source

Persist the datadir after option reset

After a reset is performed, the datadir setting is saved and readded to the settings so that it is persisted across option resets.
0.14
Andrew Chow 8 years ago
parent
commit
15df3c196b
  1. 11
      src/qt/optionsmodel.cpp

11
src/qt/optionsmodel.cpp

@ -16,6 +16,7 @@ @@ -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) @@ -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,16 @@ void OptionsModel::Reset() @@ -150,9 +154,16 @@ 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);
// default setting for OptionsModel::StartAtStartup - disabled
if (GUIUtil::GetStartOnSystemStartup())
GUIUtil::SetStartOnSystemStartup(false);

Loading…
Cancel
Save