Skip to content

Commit 21020e6

Browse files
committed
Fix yet another silly mistake
1 parent 42d5dc4 commit 21020e6

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/desktop/noo_app.cpp

+10-6
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ int NooApp::keyBinds[] = { 'L', 'K', 'G', 'H', 'D', 'A', 'W', 'S', 'P', 'Q', 'O'
4040

4141
bool NooApp::OnInit()
4242
{
43-
SetAppName("NooDS");
44-
4543
// Define the platform settings
4644
std::vector<Setting> platformSettings =
4745
{
@@ -70,10 +68,16 @@ bool NooApp::OnInit()
7068
ScreenLayout::addSettings();
7169
Settings::add(platformSettings);
7270

73-
// Try to load settings from the current directory first
74-
if (!Settings::load())
71+
// Try to load the settings
72+
if (FILE *file = fopen("noods.ini", "r"))
7573
{
76-
// Try to load from the system-specific application settings directory
74+
// Load from the working directory if a file exists
75+
fclose(file);
76+
Settings::load();
77+
}
78+
else
79+
{
80+
// Load from the system-specific application settings directory
7781
std::string settingsDir;
7882
wxStandardPaths &paths = wxStandardPaths::Get();
7983
#if defined(WINDOWS) || defined(MACOS) || !wxCHECK_VERSION(3, 1, 0)
@@ -87,6 +91,7 @@ bool NooApp::OnInit()
8791
}
8892

8993
// Create the initial frame, passing along a command line filename if given
94+
SetAppName("NooDS");
9095
frames[0] = new NooFrame(this, 0, (argc > 1) ? argv[1].ToStdString() : "");
9196

9297
// Set up the update timer
@@ -97,7 +102,6 @@ bool NooApp::OnInit()
97102
Pa_Initialize();
98103
startStream(0);
99104
startStream(1);
100-
101105
return true;
102106
}
103107

0 commit comments

Comments
 (0)