@@ -202,9 +202,9 @@ int64_t Intro::getPruneMiB() const
202202 }
203203}
204204
205- bool Intro::showIfNeeded (bool & did_show_intro, int64_t & prune_MiB )
205+ bool Intro::showIfNeeded (std::unique_ptr<Intro>& intro )
206206{
207- did_show_intro = false ;
207+ intro. reset () ;
208208
209209 QSettings settings;
210210 /* If data directory provided on command line, no need to look at settings
@@ -226,19 +226,18 @@ bool Intro::showIfNeeded(bool& did_show_intro, int64_t& prune_MiB)
226226 }
227227
228228 /* If current default data directory does not exist, let the user choose one */
229- Intro intro (0 , Params ().AssumedBlockchainSize (), Params ().AssumedChainStateSize ());
230- intro.setDataDirectory (dataDir);
231- intro.setWindowIcon (QIcon (" :icons/bitcoin" ));
232- did_show_intro = true ;
229+ intro = std::make_unique<Intro>(0 , Params ().AssumedBlockchainSize (), Params ().AssumedChainStateSize ());
230+ intro->setDataDirectory (dataDir);
231+ intro->setWindowIcon (QIcon (QStringLiteral (" :icons/bitcoin" )));
233232
234233 while (true )
235234 {
236- if (!intro. exec ())
235+ if (!intro-> exec ())
237236 {
238237 /* Cancel clicked */
239238 return false ;
240239 }
241- dataDir = intro. getDataDirectory ();
240+ dataDir = intro-> getDataDirectory ();
242241 try {
243242 if (TryCreateDirectories (GUIUtil::QStringToPath (dataDir))) {
244243 // If a new data directory has been created, make wallets subdirectory too
@@ -252,9 +251,6 @@ bool Intro::showIfNeeded(bool& did_show_intro, int64_t& prune_MiB)
252251 }
253252 }
254253
255- // Additional preferences:
256- prune_MiB = intro.getPruneMiB ();
257-
258254 settings.setValue (" strDataDir" , dataDir);
259255 settings.setValue (" fReset" , false );
260256 }
0 commit comments