Fix data directory dialog appearing on every startup
Build All Platforms / build-windows-qt (push) Waiting to run
Build All Platforms / build-windows-daemon (push) Waiting to run
Build All Platforms / build-linux-qt (push) Waiting to run
Build All Platforms / build-linux-daemon (push) Waiting to run
Build All Platforms / build-macos (push) Waiting to run
Build All Platforms / release (push) Blocked by required conditions
Build All Platforms / build-windows-qt (push) Waiting to run
Build All Platforms / build-windows-daemon (push) Waiting to run
Build All Platforms / build-linux-qt (push) Waiting to run
Build All Platforms / build-linux-daemon (push) Waiting to run
Build All Platforms / build-macos (push) Waiting to run
Build All Platforms / release (push) Blocked by required conditions
Moved setOrganizationName/setApplicationName calls BEFORE IntroDialog::pickDataDirectory() so QSettings knows where to save the user's data directory choice. Previously, QSettings was created without org/app names set, causing the "strDataDir" setting to be lost, forcing the dialog to appear on every startup. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -132,6 +132,14 @@ int main(int argc, char *argv[])
|
||||
// Command-line options take precedence:
|
||||
ParseParameters(argc, argv);
|
||||
|
||||
// Application identification (must be set before IntroDialog uses QSettings)
|
||||
app.setOrganizationName("Triangles");
|
||||
//XXX app.setOrganizationDomain("");
|
||||
if(GetBoolArg("-testnet")) // Separate UI settings for testnet
|
||||
app.setApplicationName("Triangles-Qt-testnet");
|
||||
else
|
||||
app.setApplicationName("Triangles-Qt");
|
||||
|
||||
// Show data directory selection dialog on first run (unless -datadir was passed)
|
||||
if (!IntroDialog::pickDataDirectory())
|
||||
return 0;
|
||||
@@ -147,15 +155,6 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
ReadConfigFile(mapArgs, mapMultiArgs);
|
||||
|
||||
// Application identification (must be set before OptionsModel is initialized,
|
||||
// as it is used to locate QSettings)
|
||||
app.setOrganizationName("Triangles");
|
||||
//XXX app.setOrganizationDomain("");
|
||||
if(GetBoolArg("-testnet")) // Separate UI settings for testnet
|
||||
app.setApplicationName("Triangles-Qt-testnet");
|
||||
else
|
||||
app.setApplicationName("Triangles-Qt");
|
||||
|
||||
// ... then GUI settings:
|
||||
OptionsModel optionsModel;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user