Skip to content

Commit

Permalink
reverted recent change to the way readydir path is set on a Mac (prob…
Browse files Browse the repository at this point in the history
…lem wasn't in our code but due to app translocation in Mac OS 10.12)
  • Loading branch information
Andrew Trevorrow committed Feb 24, 2017
1 parent 3e6d185 commit 2811289
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/gui/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,8 @@ bool MyApp::OnInit()
SetAppDirectory( wxString(argv[0]).mb_str(wxConvLocal) );

// now set global readydir for use elsewhere
#ifdef __WXMAC__
// wxGetCwd() is not reliable on Mac OS 10.12
readydir = wxStandardPaths::Get().GetExecutablePath();
int suffix = readydir.Find(wxT("/Contents/MacOS/"));
if (suffix == wxNOT_FOUND) {
readydir = wxGetCwd(); // hope for the best
} else {
readydir = readydir.Truncate(suffix);
// now remove "*.app" from end of path
readydir = readydir.Truncate(readydir.Find('/',true) + 1);
}
#else
readydir = wxGetCwd();
if (readydir.Last() != wxFILE_SEP_PATH) readydir += wxFILE_SEP_PATH;
#endif
readydir = wxGetCwd();
if (readydir.Last() != wxFILE_SEP_PATH) readydir += wxFILE_SEP_PATH;

::wxInitAllImageHandlers(); // make sure we can handle all sorts of images

Expand Down

0 comments on commit 2811289

Please sign in to comment.