summaryrefslogtreecommitdiff
path: root/src/libs/utils/buildablehelperlibrary.cpp
diff options
context:
space:
mode:
authorDaniel Teske <daniel.teske@theqtcompany.com>2015-03-31 18:53:42 +0200
committerDaniel Teske <daniel.teske@theqtcompany.com>2015-03-31 16:57:27 +0000
commitd64a4ffae1b2fc0247bae03c580262e6a3a3e658 (patch)
tree23b6aae4508224fd7500ec3dd07e8e6dcfd78037 /src/libs/utils/buildablehelperlibrary.cpp
parent40d112d5ecaa7bcd934b05ffbecd356f729ac131 (diff)
downloadqt-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/buildablehelperlibrary.cpp')
-rw-r--r--src/libs/utils/buildablehelperlibrary.cpp21
1 files changed, 21 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"