forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/3.4'
Conflicts: src/libs/extensionsystem/pluginview.cpp Change-Id: I410156c1003d5dc81e915110c6d432bcd71da010
This commit is contained in:
@@ -52,6 +52,20 @@
|
||||
This class has some validation logic for embedding into QWizardPage.
|
||||
*/
|
||||
|
||||
static QString appBundleExpandedPath(const QString &path)
|
||||
{
|
||||
if (Utils::HostOsInfo::hostOs() == Utils::OsTypeMac && path.endsWith(QLatin1String(".app"))) {
|
||||
// possibly expand to Foo.app/Contents/MacOS/Foo
|
||||
QFileInfo info(path);
|
||||
if (info.isDir()) {
|
||||
QString exePath = path + QLatin1String("/Contents/MacOS/") + info.completeBaseName();
|
||||
if (QFileInfo(exePath).exists())
|
||||
return exePath;
|
||||
}
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
namespace Utils {
|
||||
|
||||
// ------------------ BinaryVersionToolTipEventFilter
|
||||
@@ -362,20 +376,13 @@ 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;
|
||||
}
|
||||
}
|
||||
newPath = appBundleExpandedPath(newPath);
|
||||
break;
|
||||
case PathChooser::File: // fall through
|
||||
newPath = QFileDialog::getOpenFileName(this,
|
||||
makeDialogTitle(tr("Choose File")), predefined,
|
||||
d->m_dialogFilter);
|
||||
newPath = appBundleExpandedPath(newPath);
|
||||
break;
|
||||
case PathChooser::SaveFile:
|
||||
newPath = QFileDialog::getSaveFileName(this,
|
||||
|
||||
Reference in New Issue
Block a user