forked from qt-creator/qt-creator
Qnx: Use more FilePath for paths
Change-Id: I36f00548247cd34bbb52b452bc80978f131e5270 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -33,30 +33,28 @@
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
|
|
||||||
|
using namespace Utils;
|
||||||
|
|
||||||
namespace Qnx {
|
namespace Qnx {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
QnxBaseQtConfigWidget::QnxBaseQtConfigWidget(QnxQtVersion *version) :
|
QnxBaseQtConfigWidget::QnxBaseQtConfigWidget(QnxQtVersion *version) :
|
||||||
m_version(version),
|
m_version(version),
|
||||||
m_sdpPathChooser(new Utils::PathChooser)
|
m_sdpPathChooser(new PathChooser)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(version, return);
|
QTC_ASSERT(version, return);
|
||||||
|
|
||||||
auto layout = new QHBoxLayout(this);
|
auto layout = new QHBoxLayout(this);
|
||||||
layout->addWidget(m_sdpPathChooser);
|
layout->addWidget(m_sdpPathChooser);
|
||||||
|
|
||||||
m_sdpPathChooser->setExpectedKind(Utils::PathChooser::ExistingDirectory);
|
m_sdpPathChooser->setExpectedKind(PathChooser::ExistingDirectory);
|
||||||
m_sdpPathChooser->setHistoryCompleter(QLatin1String("Qnx.Sdp.History"));
|
m_sdpPathChooser->setHistoryCompleter("Qnx.Sdp.History");
|
||||||
m_sdpPathChooser->setPath(version->sdpPath());
|
m_sdpPathChooser->setFilePath(version->sdpPath());
|
||||||
|
|
||||||
connect(m_sdpPathChooser, &Utils::PathChooser::rawPathChanged,
|
connect(m_sdpPathChooser, &PathChooser::rawPathChanged, [this] {
|
||||||
this, &QnxBaseQtConfigWidget::updateSdpPath);
|
m_version->setSdpPath(m_sdpPathChooser->filePath());
|
||||||
}
|
emit changed();
|
||||||
|
});
|
||||||
void QnxBaseQtConfigWidget::updateSdpPath(const QString &path)
|
|
||||||
{
|
|
||||||
m_version->setSdpPath(path);
|
|
||||||
emit changed();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -27,7 +27,10 @@
|
|||||||
|
|
||||||
#include <qtsupport/qtconfigwidget.h>
|
#include <qtsupport/qtconfigwidget.h>
|
||||||
|
|
||||||
namespace Utils { class PathChooser; }
|
namespace Utils {
|
||||||
|
class PathChooser;
|
||||||
|
class FilePath;
|
||||||
|
} // Utils
|
||||||
|
|
||||||
namespace Qnx {
|
namespace Qnx {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -41,9 +44,6 @@ class QnxBaseQtConfigWidget : public QtSupport::QtConfigWidget
|
|||||||
public:
|
public:
|
||||||
explicit QnxBaseQtConfigWidget(QnxQtVersion *version);
|
explicit QnxBaseQtConfigWidget(QnxQtVersion *version);
|
||||||
|
|
||||||
private slots:
|
|
||||||
void updateSdpPath(const QString &path);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QnxQtVersion *m_version;
|
QnxQtVersion *m_version;
|
||||||
Utils::PathChooser *m_sdpPathChooser;
|
Utils::PathChooser *m_sdpPathChooser;
|
||||||
|
@@ -225,7 +225,7 @@ QnxQtVersion *QnxConfiguration::qnxQtVersion(const Target &target) const
|
|||||||
QtVersionManager::instance()->versions(Utils::equal(&BaseQtVersion::type,
|
QtVersionManager::instance()->versions(Utils::equal(&BaseQtVersion::type,
|
||||||
QString::fromLatin1(Constants::QNX_QNX_QT)))) {
|
QString::fromLatin1(Constants::QNX_QNX_QT)))) {
|
||||||
auto qnxQt = dynamic_cast<QnxQtVersion *>(version);
|
auto qnxQt = dynamic_cast<QnxQtVersion *>(version);
|
||||||
if (qnxQt && FilePath::fromString(qnxQt->sdpPath()) == sdpPath()) {
|
if (qnxQt && qnxQt->sdpPath() == sdpPath()) {
|
||||||
foreach (const Abi &qtAbi, version->qtAbis()) {
|
foreach (const Abi &qtAbi, version->qtAbis()) {
|
||||||
if ((qtAbi == target.m_abi) && (qnxQt->cpuDir() == target.cpuDir()))
|
if ((qtAbi == target.m_abi) && (qnxQt->cpuDir() == target.cpuDir()))
|
||||||
return qnxQt;
|
return qnxQt;
|
||||||
@@ -240,7 +240,7 @@ QList<ToolChain *> QnxConfiguration::autoDetect(const QList<ToolChain *> &alread
|
|||||||
{
|
{
|
||||||
QList<ToolChain *> result;
|
QList<ToolChain *> result;
|
||||||
|
|
||||||
foreach (const Target &target, m_targets)
|
for (const Target &target : qAsConst(m_targets))
|
||||||
result += findToolChain(alreadyKnown, target.m_abi);
|
result += findToolChain(alreadyKnown, target.m_abi);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@@ -286,7 +286,7 @@ QnxConfiguration::QnxToolChainMap QnxConfiguration::createToolChain(const Target
|
|||||||
"QCC for %1 (%2)")
|
"QCC for %1 (%2)")
|
||||||
.arg(displayName())
|
.arg(displayName())
|
||||||
.arg(target.shortDescription()));
|
.arg(target.shortDescription()));
|
||||||
toolChain->setSdpPath(sdpPath().toString());
|
toolChain->setSdpPath(sdpPath());
|
||||||
toolChain->setCpuDir(target.cpuDir());
|
toolChain->setCpuDir(target.cpuDir());
|
||||||
toolChain->resetToolChain(qccCompilerPath());
|
toolChain->resetToolChain(qccCompilerPath());
|
||||||
ToolChainManager::registerToolChain(toolChain);
|
ToolChainManager::registerToolChain(toolChain);
|
||||||
@@ -372,11 +372,11 @@ void QnxConfiguration::setVersion(const QnxVersionNumber &version)
|
|||||||
void QnxConfiguration::readInformation()
|
void QnxConfiguration::readInformation()
|
||||||
{
|
{
|
||||||
const QString qConfigPath = m_qnxConfiguration.pathAppended("qconfig").toString();
|
const QString qConfigPath = m_qnxConfiguration.pathAppended("qconfig").toString();
|
||||||
QList <ConfigInstallInformation> installInfoList = QnxUtils::installedConfigs(qConfigPath);
|
const QList <ConfigInstallInformation> installInfoList = QnxUtils::installedConfigs(qConfigPath);
|
||||||
if (installInfoList.isEmpty())
|
if (installInfoList.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
foreach (const ConfigInstallInformation &info, installInfoList) {
|
for (const ConfigInstallInformation &info : installInfoList) {
|
||||||
if (m_qnxHost == FilePath::fromString(info.host).canonicalPath()
|
if (m_qnxHost == FilePath::fromString(info.host).canonicalPath()
|
||||||
&& m_qnxTarget == FilePath::fromString(info.target).canonicalPath()) {
|
&& m_qnxTarget == FilePath::fromString(info.target).canonicalPath()) {
|
||||||
m_configName = info.name;
|
m_configName = info.name;
|
||||||
@@ -386,11 +386,11 @@ void QnxConfiguration::readInformation()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QnxConfiguration::setDefaultConfiguration(const Utils::FilePath &envScript)
|
void QnxConfiguration::setDefaultConfiguration(const FilePath &envScript)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(!envScript.isEmpty(), return);
|
QTC_ASSERT(!envScript.isEmpty(), return);
|
||||||
m_envFile = envScript;
|
m_envFile = envScript;
|
||||||
m_qnxEnv = QnxUtils::qnxEnvironmentFromEnvFile(m_envFile.toString());
|
m_qnxEnv = QnxUtils::qnxEnvironmentFromEnvFile(m_envFile);
|
||||||
foreach (const EnvironmentItem &item, m_qnxEnv) {
|
foreach (const EnvironmentItem &item, m_qnxEnv) {
|
||||||
if (item.name == QNXConfiguration)
|
if (item.name == QNXConfiguration)
|
||||||
m_qnxConfiguration = FilePath::fromString(item.value).canonicalPath();
|
m_qnxConfiguration = FilePath::fromString(item.value).canonicalPath();
|
||||||
|
@@ -109,14 +109,14 @@ QString QnxQtVersion::cpuDir() const
|
|||||||
QVariantMap QnxQtVersion::toMap() const
|
QVariantMap QnxQtVersion::toMap() const
|
||||||
{
|
{
|
||||||
QVariantMap result = BaseQtVersion::toMap();
|
QVariantMap result = BaseQtVersion::toMap();
|
||||||
result.insert(QLatin1String(SDP_PATH_KEY), sdpPath());
|
result.insert(SDP_PATH_KEY, sdpPath().toVariant());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QnxQtVersion::fromMap(const QVariantMap &map)
|
void QnxQtVersion::fromMap(const QVariantMap &map)
|
||||||
{
|
{
|
||||||
BaseQtVersion::fromMap(map);
|
BaseQtVersion::fromMap(map);
|
||||||
setSdpPath(QDir::fromNativeSeparators(map.value(QLatin1String(SDP_PATH_KEY)).toString()));
|
setSdpPath(FilePath::fromVariant(map.value(SDP_PATH_KEY)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Abis QnxQtVersion::detectQtAbis() const
|
Abis QnxQtVersion::detectQtAbis() const
|
||||||
@@ -134,7 +134,7 @@ void QnxQtVersion::addToEnvironment(const Kit *k, Environment &env) const
|
|||||||
env.prependOrSetLibrarySearchPath(libraryPath().toString());
|
env.prependOrSetLibrarySearchPath(libraryPath().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
void QnxQtVersion::setupQmakeRunEnvironment(Utils::Environment &env) const
|
void QnxQtVersion::setupQmakeRunEnvironment(Environment &env) const
|
||||||
{
|
{
|
||||||
if (!sdpPath().isEmpty())
|
if (!sdpPath().isEmpty())
|
||||||
updateEnvironment();
|
updateEnvironment();
|
||||||
@@ -160,12 +160,12 @@ QString QnxQtVersion::invalidReason() const
|
|||||||
return QtSupport::BaseQtVersion::invalidReason();
|
return QtSupport::BaseQtVersion::invalidReason();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QnxQtVersion::sdpPath() const
|
FilePath QnxQtVersion::sdpPath() const
|
||||||
{
|
{
|
||||||
return m_sdpPath;
|
return m_sdpPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QnxQtVersion::setSdpPath(const QString &sdpPath)
|
void QnxQtVersion::setSdpPath(const FilePath &sdpPath)
|
||||||
{
|
{
|
||||||
if (m_sdpPath == sdpPath)
|
if (m_sdpPath == sdpPath)
|
||||||
return;
|
return;
|
||||||
|
@@ -63,15 +63,15 @@ public:
|
|||||||
bool isValid() const override;
|
bool isValid() const override;
|
||||||
QString invalidReason() const override;
|
QString invalidReason() const override;
|
||||||
|
|
||||||
QString sdpPath() const;
|
Utils::FilePath sdpPath() const;
|
||||||
void setSdpPath(const QString &sdpPath);
|
void setSdpPath(const Utils::FilePath &sdpPath);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateEnvironment() const;
|
void updateEnvironment() const;
|
||||||
|
|
||||||
Utils::EnvironmentItems environment() const;
|
Utils::EnvironmentItems environment() const;
|
||||||
|
|
||||||
QString m_sdpPath;
|
Utils::FilePath m_sdpPath;
|
||||||
|
|
||||||
mutable QString m_cpuDir;
|
mutable QString m_cpuDir;
|
||||||
mutable bool m_environmentUpToDate = false;
|
mutable bool m_environmentUpToDate = false;
|
||||||
|
@@ -41,8 +41,8 @@ using namespace Utils;
|
|||||||
namespace Qnx {
|
namespace Qnx {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
static const char CompilerSdpPath[] = "Qnx.QnxToolChain.NDKPath";
|
const char CompilerSdpPath[] = "Qnx.QnxToolChain.NDKPath";
|
||||||
static const char CpuDirKey[] = "Qnx.QnxToolChain.CpuDir";
|
const char CpuDirKey[] = "Qnx.QnxToolChain.CpuDir";
|
||||||
|
|
||||||
static Abis detectTargetAbis(const FilePath &sdpPath)
|
static Abis detectTargetAbis(const FilePath &sdpPath)
|
||||||
{
|
{
|
||||||
@@ -50,8 +50,8 @@ static Abis detectTargetAbis(const FilePath &sdpPath)
|
|||||||
FilePath qnxTarget;
|
FilePath qnxTarget;
|
||||||
|
|
||||||
if (!sdpPath.fileName().isEmpty()) {
|
if (!sdpPath.fileName().isEmpty()) {
|
||||||
Utils::EnvironmentItems environment = QnxUtils::qnxEnvironment(sdpPath.toString());
|
const EnvironmentItems environment = QnxUtils::qnxEnvironment(sdpPath);
|
||||||
foreach (const Utils::EnvironmentItem &item, environment) {
|
for (const EnvironmentItem &item : environment) {
|
||||||
if (item.name == QLatin1String("QNX_TARGET"))
|
if (item.name == QLatin1String("QNX_TARGET"))
|
||||||
qnxTarget = FilePath::fromString(item.value);
|
qnxTarget = FilePath::fromString(item.value);
|
||||||
}
|
}
|
||||||
@@ -137,7 +137,7 @@ QStringList QnxToolChain::suggestedMkspecList() const
|
|||||||
QVariantMap QnxToolChain::toMap() const
|
QVariantMap QnxToolChain::toMap() const
|
||||||
{
|
{
|
||||||
QVariantMap data = GccToolChain::toMap();
|
QVariantMap data = GccToolChain::toMap();
|
||||||
data.insert(QLatin1String(CompilerSdpPath), m_sdpPath);
|
data.insert(QLatin1String(CompilerSdpPath), m_sdpPath.toVariant());
|
||||||
data.insert(QLatin1String(CpuDirKey), m_cpuDir);
|
data.insert(QLatin1String(CpuDirKey), m_cpuDir);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -147,7 +147,7 @@ bool QnxToolChain::fromMap(const QVariantMap &data)
|
|||||||
if (!GccToolChain::fromMap(data))
|
if (!GccToolChain::fromMap(data))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_sdpPath = data.value(QLatin1String(CompilerSdpPath)).toString();
|
m_sdpPath = FilePath::fromVariant(data.value(CompilerSdpPath));
|
||||||
m_cpuDir = data.value(QLatin1String(CpuDirKey)).toString();
|
m_cpuDir = data.value(QLatin1String(CpuDirKey)).toString();
|
||||||
|
|
||||||
// Make the ABIs QNX specific (if they aren't already).
|
// Make the ABIs QNX specific (if they aren't already).
|
||||||
@@ -157,12 +157,12 @@ bool QnxToolChain::fromMap(const QVariantMap &data)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QnxToolChain::sdpPath() const
|
FilePath QnxToolChain::sdpPath() const
|
||||||
{
|
{
|
||||||
return m_sdpPath;
|
return m_sdpPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QnxToolChain::setSdpPath(const QString &sdpPath)
|
void QnxToolChain::setSdpPath(const FilePath &sdpPath)
|
||||||
{
|
{
|
||||||
if (m_sdpPath == sdpPath)
|
if (m_sdpPath == sdpPath)
|
||||||
return;
|
return;
|
||||||
@@ -185,7 +185,7 @@ void QnxToolChain::setCpuDir(const QString &cpuDir)
|
|||||||
|
|
||||||
GccToolChain::DetectedAbisResult QnxToolChain::detectSupportedAbis() const
|
GccToolChain::DetectedAbisResult QnxToolChain::detectSupportedAbis() const
|
||||||
{
|
{
|
||||||
return detectTargetAbis(FilePath::fromString(m_sdpPath));
|
return detectTargetAbis(m_sdpPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QnxToolChain::operator ==(const ToolChain &other) const
|
bool QnxToolChain::operator ==(const ToolChain &other) const
|
||||||
@@ -243,7 +243,7 @@ QnxToolChainConfigWidget::QnxToolChainConfigWidget(QnxToolChain *tc)
|
|||||||
|
|
||||||
m_sdpPath->setExpectedKind(PathChooser::ExistingDirectory);
|
m_sdpPath->setExpectedKind(PathChooser::ExistingDirectory);
|
||||||
m_sdpPath->setHistoryCompleter(QLatin1String("Qnx.Sdp.History"));
|
m_sdpPath->setHistoryCompleter(QLatin1String("Qnx.Sdp.History"));
|
||||||
m_sdpPath->setPath(tc->sdpPath());
|
m_sdpPath->setFilePath(tc->sdpPath());
|
||||||
m_sdpPath->setEnabled(!tc->isAutoDetected());
|
m_sdpPath->setEnabled(!tc->isAutoDetected());
|
||||||
|
|
||||||
const Abis abiList = detectTargetAbis(m_sdpPath->filePath());
|
const Abis abiList = detectTargetAbis(m_sdpPath->filePath());
|
||||||
@@ -270,7 +270,7 @@ void QnxToolChainConfigWidget::applyImpl()
|
|||||||
Q_ASSERT(tc);
|
Q_ASSERT(tc);
|
||||||
QString displayName = tc->displayName();
|
QString displayName = tc->displayName();
|
||||||
tc->setDisplayName(displayName); // reset display name
|
tc->setDisplayName(displayName); // reset display name
|
||||||
tc->setSdpPath(m_sdpPath->filePath().toString());
|
tc->setSdpPath(m_sdpPath->filePath());
|
||||||
tc->setTargetAbi(m_abiWidget->currentAbi());
|
tc->setTargetAbi(m_abiWidget->currentAbi());
|
||||||
tc->resetToolChain(m_compilerCommand->filePath());
|
tc->resetToolChain(m_compilerCommand->filePath());
|
||||||
}
|
}
|
||||||
@@ -281,7 +281,7 @@ void QnxToolChainConfigWidget::discardImpl()
|
|||||||
QSignalBlocker blocker(this);
|
QSignalBlocker blocker(this);
|
||||||
auto tc = static_cast<const QnxToolChain *>(toolChain());
|
auto tc = static_cast<const QnxToolChain *>(toolChain());
|
||||||
m_compilerCommand->setFilePath(tc->compilerCommand());
|
m_compilerCommand->setFilePath(tc->compilerCommand());
|
||||||
m_sdpPath->setPath(tc->sdpPath());
|
m_sdpPath->setFilePath(tc->sdpPath());
|
||||||
m_abiWidget->setAbis(tc->supportedAbis(), tc->targetAbi());
|
m_abiWidget->setAbis(tc->supportedAbis(), tc->targetAbi());
|
||||||
if (!m_compilerCommand->filePath().toString().isEmpty())
|
if (!m_compilerCommand->filePath().toString().isEmpty())
|
||||||
m_abiWidget->setEnabled(true);
|
m_abiWidget->setEnabled(true);
|
||||||
@@ -292,7 +292,7 @@ bool QnxToolChainConfigWidget::isDirtyImpl() const
|
|||||||
auto tc = static_cast<const QnxToolChain *>(toolChain());
|
auto tc = static_cast<const QnxToolChain *>(toolChain());
|
||||||
Q_ASSERT(tc);
|
Q_ASSERT(tc);
|
||||||
return m_compilerCommand->filePath() != tc->compilerCommand()
|
return m_compilerCommand->filePath() != tc->compilerCommand()
|
||||||
|| m_sdpPath->filePath().toString() != tc->sdpPath()
|
|| m_sdpPath->filePath() != tc->sdpPath()
|
||||||
|| m_abiWidget->currentAbi() != tc->targetAbi();
|
|| m_abiWidget->currentAbi() != tc->targetAbi();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -46,8 +46,8 @@ public:
|
|||||||
QVariantMap toMap() const override;
|
QVariantMap toMap() const override;
|
||||||
bool fromMap(const QVariantMap &data) override;
|
bool fromMap(const QVariantMap &data) override;
|
||||||
|
|
||||||
QString sdpPath() const;
|
Utils::FilePath sdpPath() const;
|
||||||
void setSdpPath(const QString &sdpPath);
|
void setSdpPath(const Utils::FilePath &sdpPath);
|
||||||
QString cpuDir() const;
|
QString cpuDir() const;
|
||||||
void setCpuDir(const QString &cpuDir);
|
void setCpuDir(const QString &cpuDir);
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ protected:
|
|||||||
DetectedAbisResult detectSupportedAbis() const override;
|
DetectedAbisResult detectSupportedAbis() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_sdpPath;
|
Utils::FilePath m_sdpPath;
|
||||||
QString m_cpuDir;
|
QString m_cpuDir;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -78,11 +78,11 @@ QString QnxUtils::cpuDirShortDescription(const QString &cpuDir)
|
|||||||
return cpuDir;
|
return cpuDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
EnvironmentItems QnxUtils::qnxEnvironmentFromEnvFile(const QString &fileName)
|
EnvironmentItems QnxUtils::qnxEnvironmentFromEnvFile(const FilePath &filePath)
|
||||||
{
|
{
|
||||||
EnvironmentItems items;
|
EnvironmentItems items;
|
||||||
|
|
||||||
if (!QFileInfo::exists(fileName))
|
if (!filePath.exists())
|
||||||
return items;
|
return items;
|
||||||
|
|
||||||
const bool isWindows = HostOsInfo::isWindowsHost();
|
const bool isWindows = HostOsInfo::isWindowsHost();
|
||||||
@@ -97,10 +97,10 @@ EnvironmentItems QnxUtils::qnxEnvironmentFromEnvFile(const QString &fileName)
|
|||||||
QTextStream fileContent(&tmpFile);
|
QTextStream fileContent(&tmpFile);
|
||||||
if (isWindows)
|
if (isWindows)
|
||||||
fileContent << "@echo off\n"
|
fileContent << "@echo off\n"
|
||||||
<< "call " << fileName << '\n';
|
<< "call " << filePath.path() << '\n';
|
||||||
else
|
else
|
||||||
fileContent << "#!/bin/bash\n"
|
fileContent << "#!/bin/bash\n"
|
||||||
<< ". " << fileName << '\n';
|
<< ". " << filePath.path() << '\n';
|
||||||
QString linePattern = QString::fromLatin1(isWindows ? "echo %1=%%1%" : "echo %1=$%1");
|
QString linePattern = QString::fromLatin1(isWindows ? "echo %1=%%1%" : "echo %1=$%1");
|
||||||
for (int i = 0, len = sizeof(EVAL_ENV_VARS) / sizeof(const char *); i < len; ++i)
|
for (int i = 0, len = sizeof(EVAL_ENV_VARS) / sizeof(const char *); i < len; ++i)
|
||||||
fileContent << linePattern.arg(QLatin1String(EVAL_ENV_VARS[i])) << QLatin1Char('\n');
|
fileContent << linePattern.arg(QLatin1String(EVAL_ENV_VARS[i])) << QLatin1Char('\n');
|
||||||
@@ -140,19 +140,18 @@ EnvironmentItems QnxUtils::qnxEnvironmentFromEnvFile(const QString &fileName)
|
|||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QnxUtils::envFilePath(const QString &sdpPath)
|
FilePath QnxUtils::envFilePath(const FilePath &sdpPath)
|
||||||
{
|
{
|
||||||
QDir sdp(sdpPath);
|
FilePaths entries;
|
||||||
QStringList entries;
|
if (sdpPath.osType() == OsTypeWindows)
|
||||||
if (HostOsInfo::isWindowsHost())
|
entries = sdpPath.dirEntries({"*-env.bat"});
|
||||||
entries = sdp.entryList(QStringList(QLatin1String("*-env.bat")));
|
|
||||||
else
|
else
|
||||||
entries = sdp.entryList(QStringList(QLatin1String("*-env.sh")));
|
entries = sdpPath.dirEntries({"*-env.sh"});
|
||||||
|
|
||||||
if (!entries.isEmpty())
|
if (!entries.isEmpty())
|
||||||
return sdp.absoluteFilePath(entries.first());
|
return entries.first();
|
||||||
|
|
||||||
return QString();
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QnxUtils::defaultTargetVersion(const QString &sdpPath)
|
QString QnxUtils::defaultTargetVersion(const QString &sdpPath)
|
||||||
@@ -208,7 +207,7 @@ QList<ConfigInstallInformation> QnxUtils::installedConfigs(const QString &config
|
|||||||
return sdpList;
|
return sdpList;
|
||||||
}
|
}
|
||||||
|
|
||||||
EnvironmentItems QnxUtils::qnxEnvironment(const QString &sdpPath)
|
EnvironmentItems QnxUtils::qnxEnvironment(const FilePath &sdpPath)
|
||||||
{
|
{
|
||||||
return qnxEnvironmentFromEnvFile(envFilePath(sdpPath));
|
return qnxEnvironmentFromEnvFile(envFilePath(sdpPath));
|
||||||
}
|
}
|
||||||
|
@@ -68,11 +68,11 @@ class QnxUtils
|
|||||||
public:
|
public:
|
||||||
static QString cpuDirFromAbi(const ProjectExplorer::Abi &abi);
|
static QString cpuDirFromAbi(const ProjectExplorer::Abi &abi);
|
||||||
static QString cpuDirShortDescription(const QString &cpuDir);
|
static QString cpuDirShortDescription(const QString &cpuDir);
|
||||||
static Utils::EnvironmentItems qnxEnvironmentFromEnvFile(const QString &fileName);
|
static Utils::EnvironmentItems qnxEnvironmentFromEnvFile(const Utils::FilePath &filePath);
|
||||||
static QString envFilePath(const QString &sdpPath);
|
static Utils::FilePath envFilePath(const Utils::FilePath &sdpPath);
|
||||||
static QString defaultTargetVersion(const QString &sdpPath);
|
static QString defaultTargetVersion(const QString &sdpPath);
|
||||||
static QList<ConfigInstallInformation> installedConfigs(const QString &configPath = QString());
|
static QList<ConfigInstallInformation> installedConfigs(const QString &configPath = QString());
|
||||||
static Utils::EnvironmentItems qnxEnvironment(const QString &sdpPath);
|
static Utils::EnvironmentItems qnxEnvironment(const Utils::FilePath &sdpPath);
|
||||||
static QList<QnxTarget> findTargets(const Utils::FilePath &basePath);
|
static QList<QnxTarget> findTargets(const Utils::FilePath &basePath);
|
||||||
static ProjectExplorer::Abi convertAbi(const ProjectExplorer::Abi &abi);
|
static ProjectExplorer::Abi convertAbi(const ProjectExplorer::Abi &abi);
|
||||||
static ProjectExplorer::Abis convertAbis(const ProjectExplorer::Abis &abis);
|
static ProjectExplorer::Abis convertAbis(const ProjectExplorer::Abis &abis);
|
||||||
|
Reference in New Issue
Block a user