Skip to content

Commit 57acb82

Browse files
committed
Load choose datadir dialog after options reset
1 parent 15df3c1 commit 57acb82

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/qt/intro.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ void Intro::pickDataDirectory()
178178
/* 2) Allow QSettings to override default dir */
179179
dataDir = settings.value("strDataDir", dataDir).toString();
180180

181-
if(!fs::exists(GUIUtil::qstringToBoostPath(dataDir)) || GetBoolArg("-choosedatadir", DEFAULT_CHOOSE_DATADIR))
181+
if(!fs::exists(GUIUtil::qstringToBoostPath(dataDir)) || GetBoolArg("-choosedatadir", DEFAULT_CHOOSE_DATADIR) || settings.value("fReset", false).toBool() || GetBoolArg("-resetguisettings", false))
182182
{
183183
/* If current default data directory does not exist, let the user choose one */
184184
Intro intro;
@@ -204,6 +204,7 @@ void Intro::pickDataDirectory()
204204
}
205205

206206
settings.setValue("strDataDir", dataDir);
207+
settings.setValue("fReset", false);
207208
}
208209
/* Only override -datadir if different from the default, to make it possible to
209210
* override -datadir in the bitcoin.conf file in the default data directory

src/qt/optionsmodel.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ void OptionsModel::Reset()
164164
// Set strDataDir
165165
settings.setValue("strDataDir", dataDir);
166166

167+
// Set that this was reset
168+
settings.setValue("fReset", true);
169+
167170
// default setting for OptionsModel::StartAtStartup - disabled
168171
if (GUIUtil::GetStartOnSystemStartup())
169172
GUIUtil::SetStartOnSystemStartup(false);

0 commit comments

Comments
 (0)