diff options
author | Kai Koehne <kai.koehne@nokia.com> | 2011-12-19 11:30:17 +0100 |
---|---|---|
committer | Kai Koehne <kai.koehne@nokia.com> | 2011-12-19 14:52:25 +0100 |
commit | feaea9368bc0e8172276edbc1a6a414fcff22dc2 (patch) | |
tree | d7b967d7f2e8a480608e33fd367995bcb1d91115 | |
parent | 716da0d786b5dde41cf3a688c999164377a4d798 (diff) | |
download | qt-creator-feaea9368bc0e8172276edbc1a6a414fcff22dc2.tar.gz |
Find QMLViewer on Mac OS X
Let Qt Creator search for 'QMLViewer.app' instead of 'Qmlviewer.app'
on Mac OS X.
Task-number: QTCREATORBUG-5975
Change-Id: I584af98a1476b994b19b587b934ffc234760a948
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
-rw-r--r-- | src/plugins/qtsupport/baseqtversion.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 9412cabc53..157b86170b 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -476,24 +476,6 @@ QString BaseQtVersion::sourcePath() const return m_sourcePath; } -// Return a list of GUI binary names -// 'foo', 'foo.exe', 'Foo.app/Contents/MacOS/Foo' -static inline QStringList possibleGuiBinaries(const QString &name) -{ -#ifdef Q_OS_WIN - return QStringList(name + QLatin1String(".exe")); -#elif defined(Q_OS_MAC) // 'Foo.app/Contents/MacOS/Foo' - QString upCaseName = name; - upCaseName[0] = upCaseName.at(0).toUpper(); - QString macBinary = upCaseName; - macBinary += QLatin1String(".app/Contents/MacOS/"); - macBinary += upCaseName; - return QStringList(macBinary); -#else - return QStringList(name); -#endif -} - QString BaseQtVersion::designerCommand() const { if (!isValid()) @@ -555,7 +537,13 @@ QString BaseQtVersion::findQtBinary(BINARIES binary) const switch (binary) { case QmlViewer: { if (qtVersion() < QtVersionNumber(5, 0, 0)) { - possibleCommands << possibleGuiBinaries(QLatin1String("qmlviewer")); +#if defined(Q_OS_WIN) + possibleCommands << QLatin1String("qmlviewer.exe"); +#elif defined(Q_OS_MAC) + possibleCommands << QLatin1String("QMLViewer.app/Contents/MacOS/QMLViewer"); +#else + possibleCommands << QLatin1String("qmlviewer"); +#endif } else { #if defined(Q_OS_WIN) possibleCommands << QLatin1String("qmlscene.exe"); @@ -566,10 +554,22 @@ QString BaseQtVersion::findQtBinary(BINARIES binary) const } break; case Designer: - possibleCommands << possibleGuiBinaries(QLatin1String("designer")); +#if defined(Q_OS_WIN) + possibleCommands << QLatin1String("designer.exe"); +#elif defined(Q_OS_MAC) + possibleCommands << QLatin1String("Designer.app/Contents/MacOS/Designer"); +#else + possibleCommands << QLatin1String("designer"); +#endif break; case Linguist: - possibleCommands << possibleGuiBinaries(QLatin1String("linguist")); +#if defined(Q_OS_WIN) + possibleCommands << QLatin1String("linguist.exe"); +#elif defined(Q_OS_MAC) + possibleCommands << QLatin1String("Linguist.app/Contents/MacOS/Linguist"); +#else + possibleCommands << QLatin1String("linguist"); +#endif break; case Uic: #ifdef Q_OS_WIN |