summaryrefslogtreecommitdiff
path: root/src/plugins/qnx
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@digia.com>2014-06-12 13:33:51 +0200
committerEike Ziller <eike.ziller@digia.com>2014-06-12 14:33:34 +0200
commit1fda462500d3bd64e044c83520957463feba933e (patch)
treed3f922edc8e150d81dedb8fad4de2f9553c1b7f2 /src/plugins/qnx
parentde32c0fc4f94e0d7f68daf096af07a30317cafe5 (diff)
downloadqt-creator-1fda462500d3bd64e044c83520957463feba933e.tar.gz
Avoid explicit checks for windows host when working with file paths
We have fileNameCaseSensitivity and withExecutableSuffix et al. Change-Id: I79bd2cd57e258c3f15673a661a49bab597d7afa4 Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Diffstat (limited to 'src/plugins/qnx')
-rw-r--r--src/plugins/qnx/blackberryapilevelconfiguration.cpp4
-rw-r--r--src/plugins/qnx/qnxbaseconfiguration.cpp21
-rw-r--r--src/plugins/qnx/qnxutils.cpp14
-rw-r--r--src/plugins/qnx/qnxutils.h1
4 files changed, 14 insertions, 26 deletions
diff --git a/src/plugins/qnx/blackberryapilevelconfiguration.cpp b/src/plugins/qnx/blackberryapilevelconfiguration.cpp
index ef03492da4..49c3ef0709 100644
--- a/src/plugins/qnx/blackberryapilevelconfiguration.cpp
+++ b/src/plugins/qnx/blackberryapilevelconfiguration.cpp
@@ -127,8 +127,8 @@ BlackBerryApiLevelConfiguration::BlackBerryApiLevelConfiguration(const QVariantM
void BlackBerryApiLevelConfiguration::ctor()
{
QString host = qnxHost().toString();
- FileName qmake4Path = QnxUtils::executableWithExtension(FileName::fromString(host + QLatin1String("/usr/bin/qmake")));
- FileName qmake5Path = QnxUtils::executableWithExtension(FileName::fromString(host + QLatin1String("/usr/bin/qt5/qmake")));
+ FileName qmake4Path = FileName::fromString(Utils::HostOsInfo::withExecutableSuffix(host + QLatin1String("/usr/bin/qmake")));
+ FileName qmake5Path = FileName::fromString(Utils::HostOsInfo::withExecutableSuffix(host + QLatin1String("/usr/bin/qt5/qmake")));
if (qmake4Path.toFileInfo().exists())
m_qmake4BinaryFile = qmake4Path;
diff --git a/src/plugins/qnx/qnxbaseconfiguration.cpp b/src/plugins/qnx/qnxbaseconfiguration.cpp
index 4efcf0002c..e34f507626 100644
--- a/src/plugins/qnx/qnxbaseconfiguration.cpp
+++ b/src/plugins/qnx/qnxbaseconfiguration.cpp
@@ -146,16 +146,17 @@ void QnxBaseConfiguration::ctor(const FileName &envScript)
m_qnxHost = Utils::FileName::fromString(item.value);
}
- FileName qccPath = QnxUtils::executableWithExtension(
- FileName::fromString(m_qnxHost.toString() + QLatin1String("/usr/bin/qcc")));
- FileName armlev7GdbPath = QnxUtils::executableWithExtension(
- FileName::fromString(m_qnxHost.toString() + QLatin1String("/usr/bin/ntoarm-gdb")));
- if (!armlev7GdbPath.toFileInfo().exists())
- armlev7GdbPath = QnxUtils::executableWithExtension(
- FileName::fromString(m_qnxHost.toString() + QLatin1String("/usr/bin/ntoarmv7-gdb")));
-
- FileName x86GdbPath = QnxUtils::executableWithExtension(
- FileName::fromString(m_qnxHost.toString() + QLatin1String("/usr/bin/ntox86-gdb")));
+ FileName qccPath = FileName::fromString(Utils::HostOsInfo::withExecutableSuffix(
+ m_qnxHost.toString() + QLatin1String("/usr/bin/qcc")));
+ FileName armlev7GdbPath = FileName::fromString(Utils::HostOsInfo::withExecutableSuffix(
+ m_qnxHost.toString() + QLatin1String("/usr/bin/ntoarm-gdb")));
+ if (!armlev7GdbPath.toFileInfo().exists()) {
+ armlev7GdbPath = FileName::fromString(Utils::HostOsInfo::withExecutableSuffix(
+ m_qnxHost.toString() + QLatin1String("/usr/bin/ntoarmv7-gdb")));
+ }
+
+ FileName x86GdbPath = FileName::fromString(Utils::HostOsInfo::withExecutableSuffix(
+ m_qnxHost.toString() + QLatin1String("/usr/bin/ntox86-gdb")));
if (qccPath.toFileInfo().exists())
m_qccCompiler = qccPath;
diff --git a/src/plugins/qnx/qnxutils.cpp b/src/plugins/qnx/qnxutils.cpp
index 7dc0afce79..3791ecfa78 100644
--- a/src/plugins/qnx/qnxutils.cpp
+++ b/src/plugins/qnx/qnxutils.cpp
@@ -178,14 +178,6 @@ QString QnxUtils::envFilePath(const QString &ndkPath, const QString &targetVersi
return envFile;
}
-Utils::FileName QnxUtils::executableWithExtension(const Utils::FileName &fileName)
-{
- Utils::FileName result = fileName;
- if (Utils::HostOsInfo::isWindowsHost())
- result.appendString(QLatin1String(".exe"));
- return result;
-}
-
QString QnxUtils::bbDataDirPath()
{
const QString homeDir = QDir::homePath();
@@ -272,11 +264,7 @@ QList<ConfigInstallInformation> QnxUtils::installedConfigs(const QString &config
QString QnxUtils::sdkInstallerPath(const QString &ndkPath)
{
- QString sdkinstallPath;
- if (Utils::HostOsInfo::isWindowsHost())
- sdkinstallPath = ndkPath + QLatin1String("/qde.exe");
- else
- sdkinstallPath = ndkPath + QLatin1String("/qde");
+ QString sdkinstallPath = Utils::HostOsInfo::withExecutableSuffix(ndkPath + QLatin1String("/qde"));
if (QFileInfo(sdkinstallPath).exists())
return sdkinstallPath;
diff --git a/src/plugins/qnx/qnxutils.h b/src/plugins/qnx/qnxutils.h
index 963d130fc4..611d0c6558 100644
--- a/src/plugins/qnx/qnxutils.h
+++ b/src/plugins/qnx/qnxutils.h
@@ -69,7 +69,6 @@ public:
static QList<Utils::EnvironmentItem> qnxEnvironmentFromEnvFile(const QString &fileName);
static bool isValidNdkPath(const QString & ndkPath);
static QString envFilePath(const QString & ndkPath, const QString& targetVersion = QString());
- static Utils::FileName executableWithExtension(const Utils::FileName &fileName);
static QString bbDataDirPath();
static QString bbqConfigPath();
static QString defaultTargetVersion(const QString& ndkPath);