OSX: Guess actual executable from the app bundle directory

FossilOrigin-Name: 7988e53166771ea71d916a1ab714eb671d07dea8
This commit is contained in:
kostas
2015-08-22 17:32:24 +00:00
parent 521e0e7d7b
commit b148b86311
3 changed files with 19 additions and 7 deletions

View File

@@ -54,6 +54,18 @@ QString SelectExe(QWidget *parent, const QString &description)
if(!QFile::exists(path))
return QString();
#ifdef Q_OS_MACX
// Guess actual executable from bundle dir
QFileInfo fi(path);
if(fi.isDir() && path.indexOf(".app")!=-1)
{
path += "/Contents/MacOS/" + fi.baseName();
if(!QFile::exists(path))
return QString();
}
#endif
return path;
}
//-----------------------------------------------------------------------------