forked from qt-creator/qt-creator
Qnx: Fix displayed information for BlackBerry configs
* Update the target's information list when selecting a manual configuration. * Fix the target's name on Windows as QNX_TARGET value uses Unix-like separator. Task-number: QTCREATORBUG-10600 Change-Id: If1cd5ec2457c9f59f0290a74dd71fa4ffd0d73df Reviewed-by: David Kaspar <dkaspar@blackberry.com> Reviewed-by: Tobias Nätterlund <tobias.naetterlund@kdab.com> Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
This commit is contained in:
committed by
Mehdi Fekari
parent
105e5aec66
commit
7e8f2687fc
@@ -73,27 +73,27 @@ BlackBerryConfiguration::BlackBerryConfiguration(const FileName &ndkEnvFile, boo
|
||||
m_qnxEnv = QnxUtils::qnxEnvironmentFromNdkFile(m_ndkEnvFile.toString());
|
||||
|
||||
QString ndkTarget;
|
||||
QString qnxHost;
|
||||
foreach (const Utils::EnvironmentItem &item, m_qnxEnv) {
|
||||
if (item.name == QLatin1String("QNX_TARGET"))
|
||||
ndkTarget = item.value;
|
||||
|
||||
else if (item.name == QLatin1String("QNX_HOST"))
|
||||
qnxHost = item.value;
|
||||
m_qnxHost = item.value;
|
||||
|
||||
}
|
||||
|
||||
QString sep = QString::fromLatin1("%1qnx6").arg(QDir::separator());
|
||||
m_targetName = ndkTarget.split(sep).first().split(QDir::separator()).last();
|
||||
// The QNX_TARGET value is using Unix-like separator on all platforms.
|
||||
QString sep = QString::fromLatin1("/qnx6");
|
||||
m_targetName = ndkTarget.split(sep).first().split(QLatin1Char('/')).last();
|
||||
|
||||
if (QDir(ndkTarget).exists())
|
||||
m_sysRoot = FileName::fromString(ndkTarget);
|
||||
|
||||
FileName qmake4Path = QnxUtils::executableWithExtension(FileName::fromString(qnxHost + QLatin1String("/usr/bin/qmake")));
|
||||
FileName qmake5Path = QnxUtils::executableWithExtension(FileName::fromString(qnxHost + QLatin1String("/usr/bin/qt5/qmake")));
|
||||
FileName gccPath = QnxUtils::executableWithExtension(FileName::fromString(qnxHost + QLatin1String("/usr/bin/qcc")));
|
||||
FileName deviceGdbPath = QnxUtils::executableWithExtension(FileName::fromString(qnxHost + QLatin1String("/usr/bin/ntoarm-gdb")));
|
||||
FileName simulatorGdbPath = QnxUtils::executableWithExtension(FileName::fromString(qnxHost + QLatin1String("/usr/bin/ntox86-gdb")));
|
||||
FileName qmake4Path = QnxUtils::executableWithExtension(FileName::fromString(m_qnxHost + QLatin1String("/usr/bin/qmake")));
|
||||
FileName qmake5Path = QnxUtils::executableWithExtension(FileName::fromString(m_qnxHost + QLatin1String("/usr/bin/qt5/qmake")));
|
||||
FileName gccPath = QnxUtils::executableWithExtension(FileName::fromString(m_qnxHost + QLatin1String("/usr/bin/qcc")));
|
||||
FileName deviceGdbPath = QnxUtils::executableWithExtension(FileName::fromString(m_qnxHost + QLatin1String("/usr/bin/ntoarm-gdb")));
|
||||
FileName simulatorGdbPath = QnxUtils::executableWithExtension(FileName::fromString(m_qnxHost + QLatin1String("/usr/bin/ntox86-gdb")));
|
||||
|
||||
if (qmake4Path.toFileInfo().exists())
|
||||
m_qmake4BinaryFile = qmake4Path;
|
||||
@@ -126,6 +126,11 @@ QString BlackBerryConfiguration::targetName() const
|
||||
return m_targetName;
|
||||
}
|
||||
|
||||
QString BlackBerryConfiguration::qnxHost() const
|
||||
{
|
||||
return m_qnxHost;
|
||||
}
|
||||
|
||||
bool BlackBerryConfiguration::isAutoDetected() const
|
||||
{
|
||||
return m_isAutoDetected;
|
||||
|
||||
@@ -66,6 +66,7 @@ public:
|
||||
QString ndkPath() const;
|
||||
QString displayName() const;
|
||||
QString targetName() const;
|
||||
QString qnxHost() const;
|
||||
bool isAutoDetected() const;
|
||||
bool isActive() const;
|
||||
bool isValid() const;
|
||||
@@ -81,6 +82,7 @@ public:
|
||||
private:
|
||||
QString m_displayName;
|
||||
QString m_targetName;
|
||||
QString m_qnxHost;
|
||||
bool m_isAutoDetected;
|
||||
Utils::FileName m_ndkEnvFile;
|
||||
Utils::FileName m_qmake4BinaryFile;
|
||||
|
||||
@@ -144,17 +144,20 @@ void BlackBerryNDKSettingsWidget::updateInfoTable(QTreeWidgetItem* currentItem)
|
||||
if (!config)
|
||||
return;
|
||||
|
||||
foreach (const NdkInstallInformation &ndkInfo, QnxUtils::installedNdks())
|
||||
{
|
||||
m_ui->baseNameLabel->setText(config->displayName());
|
||||
m_ui->ndkPathLabel->setText(QDir::toNativeSeparators(config->ndkPath()));
|
||||
m_ui->hostLabel->setText(QDir::toNativeSeparators(config->qnxHost()));
|
||||
m_ui->targetLabel->setText(QDir::toNativeSeparators(config->sysRoot().toString()));
|
||||
m_ui->versionLabel->clear();
|
||||
// TODO: Add a versionNumber attribute for the BlackBerryConfiguration class
|
||||
if (config->isAutoDetected()) {
|
||||
foreach (const NdkInstallInformation &ndkInfo, QnxUtils::installedNdks()) {
|
||||
if (ndkInfo.name == config->displayName()) {
|
||||
m_ui->baseNameLabel->setText(ndkInfo.name);
|
||||
m_ui->ndkPathLabel->setText(ndkInfo.path);
|
||||
m_ui->versionLabel->setText(ndkInfo.version);
|
||||
m_ui->hostLabel->setText(ndkInfo.host);
|
||||
m_ui->targetLabel->setText(ndkInfo.target);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updateUi(currentItem, config);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user