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:
Eike Ziller
2013-11-18 15:10:03 +01:00
parent 9ad57119fa
commit 2e5b504613

View File

@@ -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,