diff options
author | Daniel Teske <daniel.teske@theqtcompany.com> | 2015-03-31 18:53:42 +0200 |
---|---|---|
committer | Daniel Teske <daniel.teske@theqtcompany.com> | 2015-03-31 16:57:27 +0000 |
commit | d64a4ffae1b2fc0247bae03c580262e6a3a3e658 (patch) | |
tree | 23b6aae4508224fd7500ec3dd07e8e6dcfd78037 /src/libs/utils | |
parent | 40d112d5ecaa7bcd934b05ffbecd356f729ac131 (diff) | |
download | qt-creator-d64a4ffae1b2fc0247bae03c580262e6a3a3e658.tar.gz |
Move filterForQmakeFileDialog to a place where it can be reused
Change-Id: Ie53e611b0f042b025bddb5432d8690e5bcced390
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
Diffstat (limited to 'src/libs/utils')
-rw-r--r-- | src/libs/utils/buildablehelperlibrary.cpp | 21 | ||||
-rw-r--r-- | src/libs/utils/buildablehelperlibrary.h | 1 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/libs/utils/buildablehelperlibrary.cpp b/src/libs/utils/buildablehelperlibrary.cpp index 0b1332d4e7..b8389ff9b1 100644 --- a/src/libs/utils/buildablehelperlibrary.cpp +++ b/src/libs/utils/buildablehelperlibrary.cpp @@ -141,6 +141,27 @@ QString BuildableHelperLibrary::qtVersionForQMake(const QString &qmakePath) return QString(); } +QString BuildableHelperLibrary::filterForQmakeFileDialog() +{ + QString filter = QLatin1String("qmake ("); + const QStringList commands = possibleQMakeCommands(); + for (int i = 0; i < commands.size(); ++i) { + if (i) + filter += QLatin1Char(' '); + if (HostOsInfo::isMacHost()) + // work around QTBUG-7739 that prohibits filters that don't start with * + filter += QLatin1Char('*'); + filter += commands.at(i); + if (HostOsInfo::isAnyUnixHost() && !HostOsInfo::isMacHost()) + // kde bug, we need at least one wildcard character + // see QTCREATORBUG-7771 + filter += QLatin1Char('*'); + } + filter += QLatin1Char(')'); + return filter; +} + + QStringList BuildableHelperLibrary::possibleQMakeCommands() { // On Windows it is always "qmake.exe" diff --git a/src/libs/utils/buildablehelperlibrary.h b/src/libs/utils/buildablehelperlibrary.h index d64f72c209..1b72030d50 100644 --- a/src/libs/utils/buildablehelperlibrary.h +++ b/src/libs/utils/buildablehelperlibrary.h @@ -50,6 +50,7 @@ public: static QString qtVersionForQMake(const QString &qmakePath); // returns something like qmake4, qmake, qmake-qt4 or whatever distributions have chosen (used by QtVersion) static QStringList possibleQMakeCommands(); + static QString filterForQmakeFileDialog(); static QString byInstallDataHelper(const QString &sourcePath, const QStringList &sourceFileNames, |