Commit 5b7c86d9 authored by Christian Kandeler's avatar Christian Kandeler

Qnx: Get rid of unneeded ifdefs.

Change-Id: I64581da04ace3cf6007d4b08b65361009d7e2deb
Reviewed-by: default avatarTobias Nätterlund <tobias.naetterlund@kdab.com>
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@digia.com>
parent 0fd35fcc
......@@ -66,29 +66,32 @@ QMultiMap<QString, QString> parseEnvironmentFile(const QString &fileName)
QString value = line.mid(equalIndex + 1);
#if defined Q_OS_WIN
QRegExp systemVarRegExp(QLatin1String("IF NOT DEFINED ([\\w\\d]+)\\s+set ([\\w\\d]+)=([\\w\\d]+)"));
if (line.contains(systemVarRegExp)) {
var = systemVarRegExp.cap(2);
Utils::Environment sysEnv = Utils::Environment::systemEnvironment();
QString sysVar = systemVarRegExp.cap(1);
if (sysEnv.hasKey(sysVar))
value = sysEnv.value(sysVar);
else
value = systemVarRegExp.cap(3);
if (Utils::HostOsInfo::isWindowsHost()) {
QRegExp systemVarRegExp(QLatin1String("IF NOT DEFINED ([\\w\\d]+)\\s+set "
"([\\w\\d]+)=([\\w\\d]+)"));
if (line.contains(systemVarRegExp)) {
var = systemVarRegExp.cap(2);
Utils::Environment sysEnv = Utils::Environment::systemEnvironment();
QString sysVar = systemVarRegExp.cap(1);
if (sysEnv.hasKey(sysVar))
value = sysEnv.value(sysVar);
else
value = systemVarRegExp.cap(3);
}
}
#elif defined Q_OS_UNIX
QRegExp systemVarRegExp(QLatin1String("\\$\\{([\\w\\d]+):=([\\w\\d]+)\\}")); // to match e.g. "${QNX_HOST_VERSION:=10_0_9_52}"
if (value.contains(systemVarRegExp)) {
Utils::Environment sysEnv = Utils::Environment::systemEnvironment();
QString sysVar = systemVarRegExp.cap(1);
if (sysEnv.hasKey(sysVar))
value = sysEnv.value(sysVar);
else
value = systemVarRegExp.cap(2);
else if (Utils::HostOsInfo::isAnyUnixHost()) {
// to match e.g. "${QNX_HOST_VERSION:=10_0_9_52}"
QRegExp systemVarRegExp(QLatin1String("\\$\\{([\\w\\d]+):=([\\w\\d]+)\\}"));
if (value.contains(systemVarRegExp)) {
Utils::Environment sysEnv = Utils::Environment::systemEnvironment();
QString sysVar = systemVarRegExp.cap(1);
if (sysEnv.hasKey(sysVar))
value = sysEnv.value(sysVar);
else
value = systemVarRegExp.cap(2);
}
}
#endif
if (value.startsWith(QLatin1Char('"')))
value = value.mid(1);
if (value.endsWith(QLatin1Char('"')))
......
......@@ -34,6 +34,7 @@
#include "qnxbaseqtconfigwidget.h"
#include <utils/environment.h>
#include <utils/hostosinfo.h>
#include <QDir>
......@@ -180,13 +181,10 @@ void QnxAbstractQtVersion::setDefaultSdkPath()
return;
QString envFile;
#if defined Q_OS_WIN
envFile = qtHostPrefix + QLatin1String("/bbndk-env.bat");
#elif defined Q_OS_UNIX
envFile = qtHostPrefix + QLatin1String("/bbndk-env.sh");
#endif
if (Utils::HostOsInfo::isWindowsHost())
envFile = qtHostPrefix + QLatin1String("/bbndk-env.bat");
else if (Utils::HostOsInfo::isAnyUnixHost())
envFile = qtHostPrefix + QLatin1String("/bbndk-env.sh");
if (QFileInfo(envFile).exists())
setSdkPath(qtHostPrefix);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment