forked from qt-creator/qt-creator
Select executable when selecting app bundle with path chooser
Task-number: QTCREATORBUG-9152 Change-Id: I7e665d5b713b81c9af58b4d9b93f722fc6abceee Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
@@ -387,6 +387,15 @@ void PathChooser::slotBrowse()
|
||||
newPath = QFileDialog::getOpenFileName(this,
|
||||
makeDialogTitle(tr("Choose Executable")), predefined,
|
||||
d->m_dialogFilter);
|
||||
if (HostOsInfo::hostOs() == OsTypeMac && newPath.endsWith(QLatin1String(".app"))) {
|
||||
// possibly expand to Foo.app/Contents/MacOS/Foo
|
||||
QFileInfo info(newPath);
|
||||
if (info.isDir()) {
|
||||
QString exePath = newPath + QLatin1String("/Contents/MacOS/") + info.completeBaseName();
|
||||
if (QFileInfo(exePath).isExecutable())
|
||||
newPath = exePath;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PathChooser::File: // fall through
|
||||
newPath = QFileDialog::getOpenFileName(this,
|
||||
|
||||
Reference in New Issue
Block a user