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:
skidau 2015-05-06 10:10:04 +00:00
parent 9c35a933d9
commit f7e352d5a4
1 changed files with 3 additions and 4 deletions

View File

@ -97,8 +97,8 @@ bool wxvbamApp::OnInit()
xr->Load(wxT("*.xrs"));
}
if (wxSetWorkingDirectory(wxStandardPaths::Get().GetPluginsDir() + wxT("\\xrc"))) {
if (!wxFindFirstFile(wxT("*.xrc")).empty())
wxString xrcDir = wxStandardPaths::Get().GetPluginsDir() + wxT("\\xrc");
if (wxDirExists(xrcDir) && wxSetWorkingDirectory(xrcDir) && !wxFindFirstFile(wxT("*.xrc")).empty()) {
xr->Load(wxT("*.xrc"));
}
else {
@ -106,7 +106,6 @@ bool wxvbamApp::OnInit()
xr->Load(wxT("memory:wxvbam.xrs"));
}
wxSetWorkingDirectory(cwd);
// set up config file