summaryrefslogtreecommitdiff
path: root/src/libs/utils/pathchooser.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@digia.com>2013-11-18 15:10:03 +0100
committerEike Ziller <eike.ziller@digia.com>2013-11-18 17:21:47 +0100
commit2e5b50461381bec588550883329098d10a08176f (patch)
treea2cbab327e0f6f46d80f5dc3c542b8d385a18841 /src/libs/utils/pathchooser.cpp
parent9ad57119fa8b3fcfb2b4258a163be487a8d54129 (diff)
downloadqt-creator-2e5b50461381bec588550883329098d10a08176f.tar.gz
Select executable when selecting app bundle with path chooser
Task-number: QTCREATORBUG-9152 Change-Id: I7e665d5b713b81c9af58b4d9b93f722fc6abceee Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/libs/utils/pathchooser.cpp')
-rw-r--r--src/libs/utils/pathchooser.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp
index d6e3a59301..6ff1e3efce 100644
--- a/src/libs/utils/pathchooser.cpp
+++ b/src/libs/utils/pathchooser.cpp
@@ -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,