Fixed the "Could not set current working directory" log that would appear on boot when there was no xrc sub-directory present.
This commit is contained in:
parent
9c35a933d9
commit
f7e352d5a4
|
@ -97,16 +97,15 @@ bool wxvbamApp::OnInit()
|
||||||
xr->Load(wxT("*.xrs"));
|
xr->Load(wxT("*.xrs"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wxSetWorkingDirectory(wxStandardPaths::Get().GetPluginsDir() + wxT("\\xrc"))) {
|
wxString xrcDir = wxStandardPaths::Get().GetPluginsDir() + wxT("\\xrc");
|
||||||
if (!wxFindFirstFile(wxT("*.xrc")).empty())
|
if (wxDirExists(xrcDir) && wxSetWorkingDirectory(xrcDir) && !wxFindFirstFile(wxT("*.xrc")).empty()) {
|
||||||
xr->Load(wxT("*.xrc"));
|
xr->Load(wxT("*.xrc"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// finally, load built-in xrc
|
// finally, load built-in xrc
|
||||||
xr->Load(wxT("memory:wxvbam.xrs"));
|
xr->Load(wxT("memory:wxvbam.xrs"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
wxSetWorkingDirectory(cwd);
|
wxSetWorkingDirectory(cwd);
|
||||||
|
|
||||||
// set up config file
|
// set up config file
|
||||||
|
|
Loading…
Reference in New Issue