summaryrefslogtreecommitdiff
path: root/src/plugins/qnx
diff options
context:
space:
mode:
authorEl Mehdi Fekari <mfekari@blackberry.com>2014-04-08 19:33:27 +0200
committerMehdi Fekari <mfekari@blackberry.com>2014-05-22 15:06:51 +0200
commit317fe1f447791855cc27378bfeb90d4b98b4d722 (patch)
tree6296e86d09fdb6bbc6e0b62e9a35737b946b7cae /src/plugins/qnx
parentf1795d9748be5519ff0bebb07766268222d406ca (diff)
downloadqt-creator-317fe1f447791855cc27378bfeb90d4b98b4d722.tar.gz
Qnx: Add support for pure QNX configurations
This is a first patch that adds basic support to manage user's QNX configurations. Change-Id: I273939d39e4353dabc2ae3873d7d7be6b3ca9d47 Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Diffstat (limited to 'src/plugins/qnx')
-rw-r--r--src/plugins/qnx/blackberryapilevelconfiguration.cpp22
-rw-r--r--src/plugins/qnx/blackberryapilevelconfiguration.h6
-rw-r--r--src/plugins/qnx/blackberryapplicationrunner.cpp2
-rw-r--r--src/plugins/qnx/blackberryapplicationrunner.h4
-rw-r--r--src/plugins/qnx/blackberrycheckdevicestatusstep.cpp6
-rw-r--r--src/plugins/qnx/blackberryconfigurationmanager.cpp12
-rw-r--r--src/plugins/qnx/blackberryinstallwizardpages.cpp4
-rw-r--r--src/plugins/qnx/blackberryndksettingswidget.cpp2
-rw-r--r--src/plugins/qnx/blackberryruntimeconfiguration.cpp8
-rw-r--r--src/plugins/qnx/blackberryruntimeconfiguration.h8
-rw-r--r--src/plugins/qnx/blackberrysetupwidget.cpp2
-rw-r--r--src/plugins/qnx/images/qnx-target.pngbin0 -> 3902 bytes
-rw-r--r--src/plugins/qnx/qnx.pro17
-rw-r--r--src/plugins/qnx/qnx.qbs11
-rw-r--r--src/plugins/qnx/qnx.qrc2
-rw-r--r--src/plugins/qnx/qnxbaseconfiguration.cpp14
-rw-r--r--src/plugins/qnx/qnxbaseconfiguration.h5
-rw-r--r--src/plugins/qnx/qnxconfiguration.cpp154
-rw-r--r--src/plugins/qnx/qnxconfiguration.h22
-rw-r--r--src/plugins/qnx/qnxconfigurationmanager.cpp153
-rw-r--r--src/plugins/qnx/qnxconfigurationmanager.h73
-rw-r--r--src/plugins/qnx/qnxconstants.h5
-rw-r--r--src/plugins/qnx/qnxplugin.cpp4
-rw-r--r--src/plugins/qnx/qnxsettingspage.cpp76
-rw-r--r--src/plugins/qnx/qnxsettingspage.h59
-rw-r--r--src/plugins/qnx/qnxsettingswidget.cpp221
-rw-r--r--src/plugins/qnx/qnxsettingswidget.h98
-rw-r--r--src/plugins/qnx/qnxsettingswidget.ui195
-rw-r--r--src/plugins/qnx/qnxutils.cpp21
-rw-r--r--src/plugins/qnx/qnxutils.h8
-rw-r--r--src/plugins/qnx/qnxversionnumber.cpp (renamed from src/plugins/qnx/blackberryversionnumber.cpp)26
-rw-r--r--src/plugins/qnx/qnxversionnumber.h (renamed from src/plugins/qnx/blackberryversionnumber.h)22
32 files changed, 1162 insertions, 100 deletions
diff --git a/src/plugins/qnx/blackberryapilevelconfiguration.cpp b/src/plugins/qnx/blackberryapilevelconfiguration.cpp
index 2f3035d4f8..78d8040db0 100644
--- a/src/plugins/qnx/blackberryapilevelconfiguration.cpp
+++ b/src/plugins/qnx/blackberryapilevelconfiguration.cpp
@@ -71,7 +71,6 @@ const QLatin1String NDKPathKey("NDKPath");
const QLatin1String NDKDisplayNameKey("NDKDisplayName");
const QLatin1String NDKTargetKey("NDKTarget");
const QLatin1String NDKHostKey("NDKHost");
-const QLatin1String NDKVersionKey("NDKVersion");
const QLatin1String NDKAutoDetectionSourceKey("NDKAutoDetectionSource");
const QLatin1String NDKAutoDetectedKey("NDKAutoDetectedKey");
@@ -79,7 +78,7 @@ const QLatin1String NDKAutoDetectedKey("NDKAutoDetectedKey");
bool BlackBerryApiLevelConfiguration::m_fakeConfig = false;
#endif
-BlackBerryApiLevelConfiguration::BlackBerryApiLevelConfiguration(const NdkInstallInformation &ndkInstallInfo)
+BlackBerryApiLevelConfiguration::BlackBerryApiLevelConfiguration(const ConfigInstallInformation &ndkInstallInfo)
: QnxBaseConfiguration(FileName::fromString(
QnxUtils::envFilePath(ndkInstallInfo.path, ndkInstallInfo.version)))
{
@@ -88,8 +87,8 @@ BlackBerryApiLevelConfiguration::BlackBerryApiLevelConfiguration(const NdkInstal
// The QNX_TARGET value is using Unix-like separator on all platforms.
m_targetName = ndkInstallInfo.target.split(sep).first().split(QLatin1Char('/')).last();
m_sysRoot = FileName::fromString(ndkInstallInfo.target);
- m_version = BlackBerryVersionNumber(ndkInstallInfo.version);
m_autoDetectionSource = Utils::FileName::fromString(ndkInstallInfo.installationXmlFilePath);
+ setVersion(QnxVersionNumber(ndkInstallInfo.version));
ctor();
}
@@ -104,9 +103,9 @@ BlackBerryApiLevelConfiguration::BlackBerryApiLevelConfiguration(const FileName
if (QDir(ndkTarget).exists())
m_sysRoot = FileName::fromString(ndkTarget);
- m_version = BlackBerryVersionNumber::fromNdkEnvFileName(QFileInfo(envFile().toString()).baseName());
- if (m_version.isEmpty())
- m_version = BlackBerryVersionNumber::fromTargetName(m_targetName);
+ setVersion(QnxVersionNumber::fromNdkEnvFileName(QFileInfo(envFile().toString()).baseName()));
+ if (version().isEmpty())
+ setVersion(QnxVersionNumber::fromTargetName(m_targetName));
ctor();
}
@@ -119,7 +118,6 @@ BlackBerryApiLevelConfiguration::BlackBerryApiLevelConfiguration(const QVariantM
// The QNX_TARGET value is using Unix-like separator on all platforms.
m_targetName = data.value(NDKTargetKey).toString().split(sep).first().split(QLatin1Char('/')).last();
m_sysRoot = FileName::fromString(data.value(NDKTargetKey).toString());
- m_version = BlackBerryVersionNumber(data.value(NDKVersionKey).toString());
if (data.value(QLatin1String(NDKAutoDetectedKey)).toBool())
m_autoDetectionSource = Utils::FileName::fromString(data.value(NDKAutoDetectionSourceKey).toString());
@@ -153,11 +151,6 @@ QString BlackBerryApiLevelConfiguration::targetName() const
return m_targetName;
}
-BlackBerryVersionNumber BlackBerryApiLevelConfiguration::version() const
-{
- return m_version;
-}
-
bool BlackBerryApiLevelConfiguration::isAutoDetected() const
{
return !m_autoDetectionSource.isEmpty();
@@ -217,7 +210,6 @@ QVariantMap BlackBerryApiLevelConfiguration::toMap() const
data.insert(QLatin1String(NDKDisplayNameKey), m_displayName);
data.insert(QLatin1String(NDKPathKey), ndkPath());
data.insert(QLatin1String(NDKTargetKey), m_sysRoot.toString());
- data.insert(QLatin1String(NDKVersionKey), m_version.toString());
data.insert(QLatin1String(NDKAutoDetectionSourceKey), m_autoDetectionSource.toString());
data.insert(QLatin1String(NDKAutoDetectedKey), isAutoDetected());
return data;
@@ -310,8 +302,8 @@ bool BlackBerryApiLevelConfiguration::activate()
deactivate(); // cleaning-up artifacts autodetected by old QtCreator versions
- QString armVersionName = tr("BlackBerry %1 Device").arg(m_version.toString());
- QString x86VersionName = tr("BlackBerry %1 Simulator").arg(m_version.toString());
+ QString armVersionName = tr("BlackBerry %1 Device").arg(version().toString());
+ QString x86VersionName = tr("BlackBerry %1 Simulator").arg(version().toString());
// create versions
QnxAbstractQtVersion *qt4ArmVersion = 0;
diff --git a/src/plugins/qnx/blackberryapilevelconfiguration.h b/src/plugins/qnx/blackberryapilevelconfiguration.h
index b0045b9962..c5f4e1baf4 100644
--- a/src/plugins/qnx/blackberryapilevelconfiguration.h
+++ b/src/plugins/qnx/blackberryapilevelconfiguration.h
@@ -33,7 +33,7 @@
#define BLACKBERRYCONFIGURATIONS_H
#include "qnxutils.h"
-#include "blackberryversionnumber.h"
+#include "qnxversionnumber.h"
#include "qnxbaseconfiguration.h"
#include "qnxconstants.h"
@@ -59,7 +59,7 @@ class BlackBerryApiLevelConfiguration : public QnxBaseConfiguration
{
Q_DECLARE_TR_FUNCTIONS(Qnx::Internal::BlackBerryApiLevelConfiguration)
public:
- BlackBerryApiLevelConfiguration(const NdkInstallInformation &ndkInstallInfo);
+ BlackBerryApiLevelConfiguration(const ConfigInstallInformation &ndkInstallInfo);
BlackBerryApiLevelConfiguration(const Utils::FileName &ndkEnvFile);
BlackBerryApiLevelConfiguration(const QVariantMap &data);
bool activate();
@@ -67,7 +67,6 @@ public:
QString ndkPath() const;
QString displayName() const;
QString targetName() const;
- BlackBerryVersionNumber version() const;
bool isAutoDetected() const;
Utils::FileName autoDetectionSource() const;
bool isActive() const;
@@ -92,7 +91,6 @@ protected:
private:
QString m_displayName;
QString m_targetName;
- BlackBerryVersionNumber m_version;
Utils::FileName m_autoDetectionSource;
Utils::FileName m_qmake4BinaryFile;
Utils::FileName m_qmake5BinaryFile;
diff --git a/src/plugins/qnx/blackberryapplicationrunner.cpp b/src/plugins/qnx/blackberryapplicationrunner.cpp
index a36152a092..20d210d846 100644
--- a/src/plugins/qnx/blackberryapplicationrunner.cpp
+++ b/src/plugins/qnx/blackberryapplicationrunner.cpp
@@ -89,7 +89,7 @@ BlackBerryApplicationRunner::BlackBerryApplicationRunner(const BlackBerryApplica
m_deployCmd = m_environment.searchInPath(QLatin1String(Constants::QNX_BLACKBERRY_DEPLOY_CMD));
QFileInfo fi(target->kit()->autoDetectionSource());
- m_bbApiLevelVersion = BlackBerryVersionNumber::fromNdkEnvFileName(fi.baseName());
+ m_bbApiLevelVersion = QnxVersionNumber::fromNdkEnvFileName(fi.baseName());
m_device = BlackBerryDeviceConfiguration::device(target->kit());
m_barPackage = runConfiguration->barPackage();
diff --git a/src/plugins/qnx/blackberryapplicationrunner.h b/src/plugins/qnx/blackberryapplicationrunner.h
index 490bc395f5..4834dee1ef 100644
--- a/src/plugins/qnx/blackberryapplicationrunner.h
+++ b/src/plugins/qnx/blackberryapplicationrunner.h
@@ -34,7 +34,7 @@
#include "blackberrydeviceconfiguration.h"
#include "blackberryprocessparser.h"
-#include "blackberryversionnumber.h"
+#include "qnxversionnumber.h"
#include <projectexplorer/runconfiguration.h>
@@ -138,7 +138,7 @@ private:
QTimer *m_runningStateTimer;
QProcess *m_runningStateProcess;
- BlackBerryVersionNumber m_bbApiLevelVersion;
+ QnxVersionNumber m_bbApiLevelVersion;
int m_qmlDebugServerPort;
QProcess *m_checkQmlJsDebugArgumentsProcess;
diff --git a/src/plugins/qnx/blackberrycheckdevicestatusstep.cpp b/src/plugins/qnx/blackberrycheckdevicestatusstep.cpp
index 1fa0c513ef..4069f72020 100644
--- a/src/plugins/qnx/blackberrycheckdevicestatusstep.cpp
+++ b/src/plugins/qnx/blackberrycheckdevicestatusstep.cpp
@@ -33,7 +33,7 @@
#include "blackberrycheckdevicestatusstepconfigwidget.h"
#include "blackberrydeviceinformation.h"
-#include "blackberryversionnumber.h"
+#include "qnxversionnumber.h"
#include "qnxconstants.h"
#include <projectexplorer/buildconfiguration.h>
@@ -131,7 +131,7 @@ void BlackBerryCheckDeviceStatusStep::checkDeviceInfo(int status)
}
if (m_runtimeCheckEnabled) {
- BlackBerryVersionNumber deviceRuntimeVersion(m_deviceInfo->scmBundle());
+ QnxVersionNumber deviceRuntimeVersion(m_deviceInfo->scmBundle());
QFileInfo fi(target()->kit()->autoDetectionSource());
if (deviceRuntimeVersion.isEmpty()) {
@@ -141,7 +141,7 @@ void BlackBerryCheckDeviceStatusStep::checkDeviceInfo(int status)
return;
}
- BlackBerryVersionNumber apiLevelVersion = BlackBerryVersionNumber::fromNdkEnvFileName(fi.baseName());
+ QnxVersionNumber apiLevelVersion = QnxVersionNumber::fromNdkEnvFileName(fi.baseName());
if (apiLevelVersion.isEmpty()) {
// Skip the check if device API level version is not determined
m_eventLoop->exit(true);
diff --git a/src/plugins/qnx/blackberryconfigurationmanager.cpp b/src/plugins/qnx/blackberryconfigurationmanager.cpp
index ff927195d1..82ee332933 100644
--- a/src/plugins/qnx/blackberryconfigurationmanager.cpp
+++ b/src/plugins/qnx/blackberryconfigurationmanager.cpp
@@ -210,7 +210,7 @@ void BlackBerryConfigurationManager::loadManualConfigurations()
void BlackBerryConfigurationManager::loadAutoDetectedApiLevels()
{
- foreach (const NdkInstallInformation &ndkInfo, QnxUtils::installedNdks()) {
+ foreach (const ConfigInstallInformation &ndkInfo, QnxUtils::installedConfigs()) {
BlackBerryApiLevelConfiguration *config = new BlackBerryApiLevelConfiguration(ndkInfo);
if (!addApiLevel(config)) {
delete config;
@@ -502,27 +502,27 @@ BlackBerryConfigurationManager::~BlackBerryConfigurationManager()
QString BlackBerryConfigurationManager::barsignerCskPath() const
{
- return QnxUtils::dataDirPath() + QLatin1String("/barsigner.csk");
+ return QnxUtils::bbDataDirPath() + QLatin1String("/barsigner.csk");
}
QString BlackBerryConfigurationManager::idTokenPath() const
{
- return QnxUtils::dataDirPath() + QLatin1String("/bbidtoken.csk");
+ return QnxUtils::bbDataDirPath() + QLatin1String("/bbidtoken.csk");
}
QString BlackBerryConfigurationManager::barsignerDbPath() const
{
- return QnxUtils::dataDirPath() + QLatin1String("/barsigner.db");
+ return QnxUtils::bbDataDirPath() + QLatin1String("/barsigner.db");
}
QString BlackBerryConfigurationManager::defaultKeystorePath() const
{
- return QnxUtils::dataDirPath() + QLatin1String("/author.p12");
+ return QnxUtils::bbDataDirPath() + QLatin1String("/author.p12");
}
QString BlackBerryConfigurationManager::defaultDebugTokenPath() const
{
- return QnxUtils::dataDirPath() + QLatin1String("/debugtoken.bar");
+ return QnxUtils::bbDataDirPath() + QLatin1String("/debugtoken.bar");
}
} // namespace Internal
diff --git a/src/plugins/qnx/blackberryinstallwizardpages.cpp b/src/plugins/qnx/blackberryinstallwizardpages.cpp
index e5d1b7d896..bce2ee354a 100644
--- a/src/plugins/qnx/blackberryinstallwizardpages.cpp
+++ b/src/plugins/qnx/blackberryinstallwizardpages.cpp
@@ -208,7 +208,7 @@ void BlackBerryInstallWizardNdkPage::initializePage()
QFont font;
font.setItalic(true);
m_manual->setFont(font);
- foreach (const NdkInstallInformation &ndk, QnxUtils::installedNdks()) {
+ foreach (const ConfigInstallInformation &ndk, QnxUtils::installedConfigs()) {
bool found = false;
for (int i = 0; i < m_ui->ndkPathListWidget->count(); i++) {
QListWidgetItem* item = m_ui->ndkPathListWidget->item(i);
@@ -421,7 +421,7 @@ void BlackBerryInstallWizardProcessPage::initializePage()
return;
}
- foreach (const NdkInstallInformation &ndk, QnxUtils::installedNdks()) {
+ foreach (const ConfigInstallInformation &ndk, QnxUtils::installedConfigs()) {
if (ndk.version == m_data.version) {
m_data.ndkPath = ndk.path;
m_data.target = ndk.name;
diff --git a/src/plugins/qnx/blackberryndksettingswidget.cpp b/src/plugins/qnx/blackberryndksettingswidget.cpp
index 4ab8148d6a..2a516963c3 100644
--- a/src/plugins/qnx/blackberryndksettingswidget.cpp
+++ b/src/plugins/qnx/blackberryndksettingswidget.cpp
@@ -391,7 +391,7 @@ void BlackBerryNDKSettingsWidget::handleUninstallationFinished()
const QString targetName = current->text(0);
// Check if the target is corrrecly uninstalled
- foreach (const NdkInstallInformation &ndk, QnxUtils::installedNdks()) {
+ foreach (const ConfigInstallInformation &ndk, QnxUtils::installedConfigs()) {
if (ndk.name == targetName)
return;
}
diff --git a/src/plugins/qnx/blackberryruntimeconfiguration.cpp b/src/plugins/qnx/blackberryruntimeconfiguration.cpp
index 00412a288a..86da342d35 100644
--- a/src/plugins/qnx/blackberryruntimeconfiguration.cpp
+++ b/src/plugins/qnx/blackberryruntimeconfiguration.cpp
@@ -46,13 +46,13 @@ const QLatin1String VersionKey("Version");
BlackBerryRuntimeConfiguration::BlackBerryRuntimeConfiguration(
const QString &path,
- const BlackBerryVersionNumber &version)
+ const QnxVersionNumber &version)
: m_path(path)
{
if (!version.isEmpty())
m_version = version;
else
- m_version = BlackBerryVersionNumber::fromFileName(QFileInfo(path).baseName(),
+ m_version = QnxVersionNumber::fromFileName(QFileInfo(path).baseName(),
QRegExp(QLatin1String("^runtime_(.*)$")));
m_displayName = QCoreApplication::translate("Qnx::Internal::BlackBerryRuntimeConfiguration", "Runtime %1").arg(m_version.toString());
@@ -62,7 +62,7 @@ BlackBerryRuntimeConfiguration::BlackBerryRuntimeConfiguration(const QVariantMap
{
m_path = data.value(QLatin1String(PathKey)).toString();
m_displayName = data.value(QLatin1String(DisplayNameKey)).toString();
- m_version = BlackBerryVersionNumber(data.value(QLatin1String(VersionKey)).toString());
+ m_version = QnxVersionNumber(data.value(QLatin1String(VersionKey)).toString());
}
QString BlackBerryRuntimeConfiguration::path() const
@@ -75,7 +75,7 @@ QString BlackBerryRuntimeConfiguration::displayName() const
return m_displayName;
}
-BlackBerryVersionNumber BlackBerryRuntimeConfiguration::version() const
+QnxVersionNumber BlackBerryRuntimeConfiguration::version() const
{
return m_version;
}
diff --git a/src/plugins/qnx/blackberryruntimeconfiguration.h b/src/plugins/qnx/blackberryruntimeconfiguration.h
index ac6448b51b..97440185c0 100644
--- a/src/plugins/qnx/blackberryruntimeconfiguration.h
+++ b/src/plugins/qnx/blackberryruntimeconfiguration.h
@@ -32,7 +32,7 @@
#ifndef BLACKBERRYRUNTIMECONFIGURATION_H
#define BLACKBERRYRUNTIMECONFIGURATION_H
-#include "blackberryversionnumber.h"
+#include "qnxversionnumber.h"
#include <QVariantMap>
@@ -42,18 +42,18 @@ class BlackBerryRuntimeConfiguration
{
public:
BlackBerryRuntimeConfiguration(const QString &path,
- const BlackBerryVersionNumber &version = BlackBerryVersionNumber());
+ const QnxVersionNumber &version = QnxVersionNumber());
BlackBerryRuntimeConfiguration(const QVariantMap &data);
QString path() const;
QString displayName() const;
- BlackBerryVersionNumber version() const;
+ QnxVersionNumber version() const;
QVariantMap toMap() const;
private:
QString m_path;
QString m_displayName;
- BlackBerryVersionNumber m_version;
+ QnxVersionNumber m_version;
};
}
diff --git a/src/plugins/qnx/blackberrysetupwidget.cpp b/src/plugins/qnx/blackberrysetupwidget.cpp
index c6f8dc9215..911715510c 100644
--- a/src/plugins/qnx/blackberrysetupwidget.cpp
+++ b/src/plugins/qnx/blackberrysetupwidget.cpp
@@ -177,7 +177,7 @@ APILevelSetupItem::FoundTypes APILevelSetupItem::resolvedFoundType()
FoundTypes found;
// TODO: for now, all Trunk versions are understood as 10.2 compliant
- BlackBerryVersionNumber version_10_2(QLatin1String("10.2.0.0"));
+ QnxVersionNumber version_10_2(QLatin1String("10.2.0.0"));
foreach (BlackBerryApiLevelConfiguration *config,
BlackBerryConfigurationManager::instance()->apiLevels()) {
found |= Any;
diff --git a/src/plugins/qnx/images/qnx-target.png b/src/plugins/qnx/images/qnx-target.png
new file mode 100644
index 0000000000..02a0fe6da5
--- /dev/null
+++ b/src/plugins/qnx/images/qnx-target.png
Binary files differ
diff --git a/src/plugins/qnx/qnx.pro b/src/plugins/qnx/qnx.pro
index e484cb38fc..5f57fd50c5 100644
--- a/src/plugins/qnx/qnx.pro
+++ b/src/plugins/qnx/qnx.pro
@@ -91,7 +91,6 @@ SOURCES += qnxplugin.cpp \
qnxdeviceprocesslist.cpp \
qnxtoolchain.cpp \
slog2inforunner.cpp \
- blackberryversionnumber.cpp \
blackberrydebugtokenpinsdialog.cpp \
blackberrycheckdevicestatusstepfactory.cpp \
blackberrycheckdevicestatusstepconfigwidget.cpp \
@@ -107,7 +106,11 @@ SOURCES += qnxplugin.cpp \
bardescriptorfilenode.cpp \
bardescriptorfilenodemanager.cpp \
qnxconfiguration.cpp \
- qnxbaseconfiguration.cpp
+ qnxbaseconfiguration.cpp \
+ qnxsettingswidget.cpp \
+ qnxconfigurationmanager.cpp \
+ qnxsettingspage.cpp \
+ qnxversionnumber.cpp
HEADERS += qnxplugin.h\
qnxconstants.h \
@@ -199,7 +202,6 @@ HEADERS += qnxplugin.h\
qnxdeviceprocesslist.h \
qnxtoolchain.h \
slog2inforunner.h \
- blackberryversionnumber.h \
blackberrydebugtokenpinsdialog.h \
blackberrycheckdevicestatusstep.h \
blackberrycheckdevicestatusstepfactory.h \
@@ -215,7 +217,11 @@ HEADERS += qnxplugin.h\
bardescriptorfilenode.h \
bardescriptorfilenodemanager.h \
qnxconfiguration.h \
- qnxbaseconfiguration.h
+ qnxbaseconfiguration.h \
+ qnxsettingswidget.h \
+ qnxconfigurationmanager.h \
+ qnxsettingspage.h \
+ qnxversionnumber.h
FORMS += \
blackberrydeviceconfigurationwizardsetuppage.ui \
@@ -245,7 +251,8 @@ FORMS += \
blackberryinstallwizardoptionpage.ui \
blackberrydebugtokenpinsdialog.ui \
blackberrycheckdevicestatusstepconfigwidget.ui \
- blackberrydeployqtlibrariesdialog.ui
+ blackberrydeployqtlibrariesdialog.ui \
+ qnxsettingswidget.ui
include(../../private_headers.pri)
include(./cascadesimport/cascadesimport.pri)
diff --git a/src/plugins/qnx/qnx.qbs b/src/plugins/qnx/qnx.qbs
index 0159a1cad7..a94186857f 100644
--- a/src/plugins/qnx/qnx.qbs
+++ b/src/plugins/qnx/qnx.qbs
@@ -197,8 +197,6 @@ QtcPlugin {
"blackberrysshkeysgenerator.h",
"blackberrysigningutils.cpp",
"blackberrysigningutils.h",
- "blackberryversionnumber.cpp",
- "blackberryversionnumber.h",
"pathchooserdelegate.cpp",
"pathchooserdelegate.h",
"qnxtoolchain.cpp",
@@ -244,6 +242,15 @@ QtcPlugin {
"qnxdeviceprocesssignaloperation.h",
"qnxdevicetester.cpp",
"qnxdevicetester.h",
+ "qnxsettingswidget.cpp",
+ "qnxsettingswidget.h",
+ "qnxsettingswidget.ui",
+ "qnxconfigurationmanager.cpp",
+ "qnxconfigurationmanager.h",
+ "qnxsettingspage.cpp",
+ "qnxsettingspage.h",
+ "qnxversionnumber.cpp",
+ "qnxversionnumber.h",
"qnxplugin.cpp",
"qnxplugin.h",
"qnxqtversion.cpp",
diff --git a/src/plugins/qnx/qnx.qrc b/src/plugins/qnx/qnx.qrc
index e449f9a5d3..0d50275c90 100644
--- a/src/plugins/qnx/qnx.qrc
+++ b/src/plugins/qnx/qnx.qrc
@@ -6,5 +6,7 @@
<file>images/info.png</file>
<file>images/warning.png</file>
<file>images/error.png</file>
+ <file>images/qnx-target.png</file>
</qresource>
+ <qresource prefix="/"/>
</RCC>
diff --git a/src/plugins/qnx/qnxbaseconfiguration.cpp b/src/plugins/qnx/qnxbaseconfiguration.cpp
index eb3c4fc5e0..4efcf0002c 100644
--- a/src/plugins/qnx/qnxbaseconfiguration.cpp
+++ b/src/plugins/qnx/qnxbaseconfiguration.cpp
@@ -47,9 +47,11 @@ namespace Qnx {
namespace Internal {
const QLatin1String QNXEnvFileKey("EnvFile");
+const QLatin1String QNXVersionKey("QNXVersion");
// For backward compatibility
const QLatin1String NDKEnvFileKey("NDKEnvFile");
+
using namespace Utils;
using namespace ProjectExplorer;
@@ -68,6 +70,7 @@ QnxBaseConfiguration::QnxBaseConfiguration(const QVariantMap &data)
if (envFilePath.isEmpty())
envFilePath = data.value(NDKEnvFileKey).toString();
+ m_version = QnxVersionNumber(data.value(QNXVersionKey).toString());
ctor(FileName::fromString(envFilePath));
}
@@ -110,10 +113,16 @@ QList<EnvironmentItem> QnxBaseConfiguration::qnxEnv() const
return m_qnxEnv;
}
+QnxVersionNumber QnxBaseConfiguration::version() const
+{
+ return m_version;
+}
+
QVariantMap QnxBaseConfiguration::toMap() const
{
QVariantMap data;
data.insert(QLatin1String(QNXEnvFileKey), m_envFile.toString());
+ data.insert(QLatin1String(QNXVersionKey), m_version.toString());
return data;
}
@@ -201,5 +210,10 @@ QStringList QnxBaseConfiguration::validationErrors() const
return errorStrings;
}
+void QnxBaseConfiguration::setVersion(const QnxVersionNumber &version)
+{
+ m_version = version;
+}
+
}
}
diff --git a/src/plugins/qnx/qnxbaseconfiguration.h b/src/plugins/qnx/qnxbaseconfiguration.h
index 754c384279..53429f60b0 100644
--- a/src/plugins/qnx/qnxbaseconfiguration.h
+++ b/src/plugins/qnx/qnxbaseconfiguration.h
@@ -33,6 +33,7 @@
#include "qnxconstants.h"
#include "qnxutils.h"
+#include "qnxversionnumber.h"
#include <utils/fileutils.h>
#include <utils/environment.h>
@@ -64,6 +65,7 @@ public:
Utils::FileName armDebuggerPath() const;
Utils::FileName x86DebuggerPath() const;
QList<Utils::EnvironmentItem> qnxEnv() const;
+ QnxVersionNumber version() const;
QVariantMap toMap() const;
virtual bool isValid() const;
@@ -80,6 +82,7 @@ protected:
const QString &ndkPath);
virtual QStringList validationErrors() const;
+ void setVersion(const QnxVersionNumber& version);
private:
Utils::FileName m_envFile;
Utils::FileName m_qnxTarget;
@@ -88,8 +91,10 @@ private:
Utils::FileName m_armlev7Debugger;
Utils::FileName m_x86Debugger;
QList<Utils::EnvironmentItem> m_qnxEnv;
+ QnxVersionNumber m_version;
void ctor(const Utils::FileName &envFile);
+
};
}
diff --git a/src/plugins/qnx/qnxconfiguration.cpp b/src/plugins/qnx/qnxconfiguration.cpp
index 751a494208..4d9ffa24bb 100644
--- a/src/plugins/qnx/qnxconfiguration.cpp
+++ b/src/plugins/qnx/qnxconfiguration.cpp
@@ -29,23 +29,52 @@
****************************************************************************/
#include "qnxconfiguration.h"
+#include "qnxqtversion.h"
#include "qnxutils.h"
-
#include "qnxtoolchain.h"
+
#include "debugger/debuggeritem.h"
#include <projectexplorer/toolchainmanager.h>
+#include <projectexplorer/kit.h>
+#include <projectexplorer/kitmanager.h>
+
+#include <qtsupport/baseqtversion.h>
+#include <qtsupport/qtversionmanager.h>
+#include <qtsupport/qtkitinformation.h>
+
+#include <qmakeprojectmanager/qmakekitinformation.h>
+
+#include <debugger/debuggeritemmanager.h>
+#include <debugger/debuggerkitinformation.h>
#include <coreplugin/icore.h>
#include <QMessageBox>
#include <QFileInfo>
+using namespace ProjectExplorer;
+using namespace QtSupport;
+using namespace Utils;
+using namespace Debugger;
+
namespace Qnx {
namespace Internal {
QnxConfiguration::QnxConfiguration(const Utils::FileName &sdpEnvFile)
: QnxBaseConfiguration(sdpEnvFile)
{
+ readInformation();
+}
+
+QnxConfiguration::QnxConfiguration(const QVariantMap &data)
+ : QnxBaseConfiguration(data)
+{
+ readInformation();
+}
+
+QString QnxConfiguration::displayName() const
+{
+ return m_configName;
}
bool QnxConfiguration::activate()
@@ -64,19 +93,23 @@ bool QnxConfiguration::activate()
}
// Create and register toolchain
- createToolChain(QnxArchitecture::ArmLeV7,
- tr("QCC for QNX armlev7"),
+ QnxToolChain *armTc = createToolChain(ArmLeV7,
+ tr("QCC for %1 (armlev7)").arg(displayName()),
sdpPath().toString());
- createToolChain(QnxArchitecture::X86,
- tr("QCC for QNX x86"),
+ QnxToolChain *x86Tc = createToolChain(X86,
+ tr("QCC for %1 (x86)").arg(displayName()),
sdpPath().toString());
// Create and register debuggers
- createDebuggerItem(QnxArchitecture::ArmLeV7,
- tr("Debugger for QNX armlev7"));
+ QVariant armDebuggerId = createDebuggerItem(ArmLeV7,
+ tr("Debugger for %1 (armlev7)").arg(displayName()));
+
+ QVariant x86DebuggerId = createDebuggerItem(X86,
+ tr("Debugger for %1 (x86)").arg(displayName()));
- createDebuggerItem(QnxArchitecture::X86,
- tr("Debugger for QNX x86"));
+ // Create and register kits
+ createKit(ArmLeV7, armTc, armDebuggerId, tr("Kit for %1 (Device)").arg(displayName()));
+ createKit(X86, x86Tc, x86DebuggerId, tr("Kit for %1 (Simulator)").arg(displayName()));
return true;
}
@@ -86,19 +119,34 @@ void QnxConfiguration::deactivate()
if (!isActive())
return;
+ QList<ProjectExplorer::ToolChain *> toolChainsToRemove;
+ QList<Debugger::DebuggerItem> debuggersToRemove;
foreach (ProjectExplorer::ToolChain *tc,
ProjectExplorer::ToolChainManager::toolChains()) {
if (tc->compilerCommand() == qccCompilerPath())
- ProjectExplorer::ToolChainManager::deregisterToolChain(tc);
+ toolChainsToRemove.append(tc);
}
foreach (Debugger::DebuggerItem debuggerItem,
Debugger::DebuggerItemManager::debuggers()) {
if (debuggerItem.command() == armDebuggerPath() ||
debuggerItem.command() == x86DebuggerPath())
- Debugger::DebuggerItemManager::
- deregisterDebugger(debuggerItem.id());
+ debuggersToRemove.append(debuggerItem);
+ }
+
+ foreach (Kit *kit, KitManager::kits()) {
+ if (kit->isAutoDetected()
+ && DeviceTypeKitInformation::deviceTypeId(kit) == Constants::QNX_BB_OS_TYPE
+ && toolChainsToRemove.contains(ToolChainKitInformation::toolChain(kit)))
+ KitManager::deregisterKit(kit);
}
+
+ foreach (ProjectExplorer::ToolChain *tc, toolChainsToRemove)
+ ProjectExplorer::ToolChainManager::deregisterToolChain(tc);
+
+ foreach (Debugger::DebuggerItem debuggerItem, debuggersToRemove)
+ Debugger::DebuggerItemManager::
+ deregisterDebugger(debuggerItem.id());
}
bool QnxConfiguration::isActive() const
@@ -125,10 +173,92 @@ bool QnxConfiguration::isActive() const
return hasToolChain && hasDebugger;
}
+bool QnxConfiguration::canCreateKits() const
+{
+ return isValid() && (qnxQtVersion(ArmLeV7) || qnxQtVersion(X86));
+}
+
Utils::FileName QnxConfiguration::sdpPath() const
{
return envFile().parentDir();
}
+QnxQtVersion* QnxConfiguration::qnxQtVersion(QnxArchitecture arch) const
+{
+ QnxQtVersion *qnxQt;
+ foreach (BaseQtVersion *version,
+ QtVersionManager::instance()->versions()) {
+ if (version->type() == QLatin1String(Constants::QNX_QNX_QT)) {
+ qnxQt = dynamic_cast<QnxQtVersion*>(version);
+ if (qnxQt && qnxQt->architecture() == arch) {
+ return qnxQt;
+ }
+ }
+ }
+
+ return 0;
+}
+
+ProjectExplorer::Kit *QnxConfiguration::createKit(QnxArchitecture arch,
+ QnxToolChain *toolChain,
+ const QVariant &debuggerItemId,
+ const QString &displayName)
+{
+ QnxQtVersion *qnxQt = qnxQtVersion(arch);
+ // Do not create incomplete kits if no qt qnx version found
+ if (!qnxQt)
+ return 0;
+
+ Kit *kit = new ProjectExplorer::Kit;
+
+ QtKitInformation::setQtVersion(kit, qnxQt);
+ ToolChainKitInformation::setToolChain(kit, toolChain);
+
+ if (debuggerItemId.isValid())
+ DebuggerKitInformation::setDebugger(kit, debuggerItemId);
+
+ if (arch == X86) {
+ QmakeProjectManager::QmakeKitInformation::setMkspec(
+ kit, FileName::fromLatin1("qnx-x86-qcc"));
+ } else {
+ QmakeProjectManager::QmakeKitInformation::setMkspec(
+ kit, FileName::fromLatin1("qnx-armv7le-qcc"));
+ }
+
+ DeviceTypeKitInformation::setDeviceTypeId(kit, Constants::QNX_BB_OS_TYPE);
+ // TODO: Add sysroot?
+
+ kit->setDisplayName(displayName);
+ kit->setIconPath(FileName::fromString(QLatin1String(Constants::QNX_BB_CATEGORY_ICON)));
+
+ kit->setAutoDetected(true);
+ kit->setAutoDetectionSource(envFile().toString());
+ kit->setMutable(DeviceKitInformation::id(), true);
+
+ kit->setSticky(ToolChainKitInformation::id(), true);
+ kit->setSticky(DeviceTypeKitInformation::id(), true);
+ kit->setSticky(SysRootKitInformation::id(), true);
+ kit->setSticky(DebuggerKitInformation::id(), true);
+ kit->setSticky(QmakeProjectManager::QmakeKitInformation::id(), true);
+
+ // add kit with device and qt version not sticky
+ KitManager::registerKit(kit);
+ return kit;
+}
+
+void QnxConfiguration::readInformation()
+{
+ QString qConfigPath = sdpPath().toString() + QLatin1String("/.qnx/qconfig");
+ QList <ConfigInstallInformation> installInfoList = QnxUtils::installedConfigs(qConfigPath);
+ if (installInfoList.isEmpty())
+ return;
+
+ // TODO: For now (6.6) it should be one installation file. The code need to handle cases
+ // where the SDP support many target/host installations (i.e many installation files).
+ const ConfigInstallInformation installInfo = installInfoList.first();
+ m_configName = installInfo.name;
+ setVersion(QnxVersionNumber(installInfo.version));
+}
+
}
}
diff --git a/src/plugins/qnx/qnxconfiguration.h b/src/plugins/qnx/qnxconfiguration.h
index bf42feeab6..8fc3dd2859 100644
--- a/src/plugins/qnx/qnxconfiguration.h
+++ b/src/plugins/qnx/qnxconfiguration.h
@@ -32,18 +32,38 @@
#define QNXCONFIGURATION_H
#include "qnxbaseconfiguration.h"
+#include "qnxversionnumber.h"
+
+namespace ProjectExplorer { class Kit; }
namespace Qnx {
namespace Internal {
+class QnxQtVersion;
class QnxConfiguration : public QnxBaseConfiguration
{
+ Q_DECLARE_TR_FUNCTIONS(Qnx::Internal::QnxConfiguration)
+
public:
QnxConfiguration(const Utils::FileName &sdpEnvFile);
+ QnxConfiguration(const QVariantMap &data);
+ QString displayName() const;
bool activate();
void deactivate();
bool isActive() const;
-
+ bool canCreateKits() const;
Utils::FileName sdpPath() const;
+ QnxQtVersion* qnxQtVersion(QnxArchitecture arch) const;
+
+private:
+ QString m_configName;
+ QnxQtVersion *m_qtVersion;
+
+ ProjectExplorer::Kit *createKit(QnxArchitecture arch,
+ QnxToolChain *toolChain,
+ const QVariant &debuggerItemId,
+ const QString &displayName);
+
+ void readInformation();
};
diff --git a/src/plugins/qnx/qnxconfigurationmanager.cpp b/src/plugins/qnx/qnxconfigurationmanager.cpp
new file mode 100644
index 0000000000..de32d2d405
--- /dev/null
+++ b/src/plugins/qnx/qnxconfigurationmanager.cpp
@@ -0,0 +1,153 @@
+/**************************************************************************
+**
+** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
+**
+** Contact: BlackBerry (qt@blackberry.com)
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include "qnxconfigurationmanager.h"
+#include "qnxconfiguration.h"
+
+#include <coreplugin/icore.h>
+#include <utils/persistentsettings.h>
+
+namespace Qnx {
+namespace Internal {
+
+
+const QLatin1String QNXConfigDataKey("QNXConfiguration.");
+const QLatin1String QNXConfigCountKey("QNXConfiguration.Count");
+const QLatin1String QNXConfigsFileVersionKey("Version");
+
+static Utils::FileName qnxConfigSettingsFileName()
+{
+ return Utils::FileName::fromString(Core::ICore::userResourcePath() + QLatin1String("/qnx/")
+ + QLatin1String(Constants::QNX_CONFIGS_FILENAME));
+}
+
+QnxConfigurationManager *QnxConfigurationManager::m_instance = 0;
+
+QnxConfigurationManager::QnxConfigurationManager(QObject *parent)
+ : QObject(parent)
+{
+ m_instance = this;
+ m_writer = new Utils::PersistentSettingsWriter(qnxConfigSettingsFileName(),
+ QLatin1String("QnxConfigurations"));
+ restoreConfigurations();
+ connect(Core::ICore::instance(), SIGNAL(saveSettingsRequested()),
+ this, SLOT(saveConfigs()));
+}
+
+QnxConfigurationManager *QnxConfigurationManager::instance()
+{
+ return m_instance;
+}
+
+QnxConfigurationManager::~QnxConfigurationManager()
+{
+ m_instance = 0;
+ qDeleteAll(m_configurations);
+}
+
+QList<QnxConfiguration *> QnxConfigurationManager::configurations() const
+{
+ return m_configurations;
+}
+
+void QnxConfigurationManager::removeConfiguration(QnxConfiguration *config)
+{
+ if (m_configurations.removeAll(config)) {
+ delete config;
+ emit configurationsListUpdated();
+ }
+}
+
+bool QnxConfigurationManager::addConfiguration(QnxConfiguration *config)
+{
+ if (!config || !config->isValid())
+ return false;
+
+ foreach (QnxConfiguration *c, m_configurations) {
+ if (c->envFile() == config->envFile())
+ return false;
+ }
+
+ m_configurations.append(config);
+ emit configurationsListUpdated();
+ return true;
+}
+
+QnxConfiguration *QnxConfigurationManager::configurationFromEnvFile(const Utils::FileName &envFile) const
+{
+ foreach (QnxConfiguration *c, m_configurations) {
+ if (c->envFile() == envFile)
+ return c;
+ }
+
+ return 0;
+}
+
+void QnxConfigurationManager::saveConfigs()
+{
+ QTC_ASSERT(m_writer, return);
+ QVariantMap data;
+ data.insert(QLatin1String(QNXConfigsFileVersionKey), 1);
+ int count = 0;
+ foreach (QnxConfiguration *config, m_configurations) {
+ QVariantMap tmp = config->toMap();
+ if (tmp.isEmpty())
+ continue;
+
+ data.insert(QNXConfigDataKey + QString::number(count), tmp);
+ ++count;
+ }
+
+
+ data.insert(QLatin1String(QNXConfigCountKey), count);
+ m_writer->save(data, Core::ICore::mainWindow());
+}
+
+void QnxConfigurationManager::restoreConfigurations()
+{
+ Utils::PersistentSettingsReader reader;
+ if (!reader.load(qnxConfigSettingsFileName()))
+ return;
+
+ QVariantMap data = reader.restoreValues();
+ int count = data.value(QNXConfigCountKey, 0).toInt();
+ for (int i = 0; i < count; ++i) {
+ const QString key = QNXConfigDataKey + QString::number(i);
+ if (!data.contains(key))
+ continue;
+
+ const QVariantMap dMap = data.value(key).toMap();
+ QnxConfiguration *configuration = new QnxConfiguration(dMap);
+ addConfiguration(configuration);
+ }
+}
+
+}
+}
diff --git a/src/plugins/qnx/qnxconfigurationmanager.h b/src/plugins/qnx/qnxconfigurationmanager.h
new file mode 100644
index 0000000000..0a708afab5
--- /dev/null
+++ b/src/plugins/qnx/qnxconfigurationmanager.h
@@ -0,0 +1,73 @@
+/**************************************************************************
+**
+** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
+**
+** Contact: BlackBerry (qt@blackberry.com)
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#ifndef QNXCONFIGURATIONMANAGER_H
+#define QNXCONFIGURATIONMANAGER_H
+
+#include <utils/fileutils.h>
+
+namespace Utils { class PersistentSettingsWriter; }
+namespace Qnx {
+namespace Internal {
+
+class QnxConfiguration;
+class QnxPlugin;
+
+class QnxConfigurationManager: public QObject
+{
+ Q_OBJECT
+public:
+ static QnxConfigurationManager *instance();
+ ~QnxConfigurationManager();
+ QList<QnxConfiguration*> configurations() const;
+ void removeConfiguration(QnxConfiguration *config);
+ bool addConfiguration(QnxConfiguration *config);
+ QnxConfiguration* configurationFromEnvFile(const Utils::FileName &envFile) const;
+
+protected slots:
+ void saveConfigs();
+
+signals:
+ void configurationsListUpdated();
+
+private:
+ QnxConfigurationManager(QObject *parent = 0);
+ static QnxConfigurationManager *m_instance;
+ QList<QnxConfiguration*> m_configurations;
+ Utils::PersistentSettingsWriter *m_writer;
+ void restoreConfigurations();
+
+ friend class QnxPlugin;
+};
+
+}
+}
+
+#endif // QNXCONFIGURATIONMANAGER_H
diff --git a/src/plugins/qnx/qnxconstants.h b/src/plugins/qnx/qnxconstants.h
index 4cd257e1ee..eafc8b7842 100644
--- a/src/plugins/qnx/qnxconstants.h
+++ b/src/plugins/qnx/qnxconstants.h
@@ -94,10 +94,14 @@ const char QNX_TOOLCHAIN_ID[] = "Qnx.QccToolChain";
// BlackBerry settings constants
const char QNX_BB_CATEGORY[] = "XF.BlackBerry";
+const char QNX_CATEGORY[] = "XF.Qnx";
const char QNX_BB_CATEGORY_TR[] = QT_TRANSLATE_NOOP("BlackBerry", "BlackBerry");
+const char QNX_CATEGORY_TR[] = QT_TRANSLATE_NOOP("QNX", "QNX");
const char QNX_BB_CATEGORY_ICON[] = ":/qnx/images/target.png";
+const char QNX_CATEGORY_ICON[] = ":/qnx/images/qnx-target.png";
const char QNX_BB_SETUP_ID[] = "ZA.BlackBerry Setup";
const char QNX_BB_NDK_SETTINGS_ID[] = "ZZ.BlackBerry NDK Configuration";
+const char QNX_SETTINGS_ID[] = "ZZ.Qnx Configuration";
const char QNX_BB_SIGNING_ID[] = "ZZ.BlackBerry Signing Infrastructure Configuration";
const char QNX_BAR_DESCRIPTOR_MIME_TYPE[] = "application/vnd.rim.qnx.bar_descriptor";
@@ -115,6 +119,7 @@ const char QNX_BLACKBERRY_DEPLOY_CMD[] = "blackberry-deploy";
const char QNX_BLACKBERRY_CASCADESIMPORTER_VERSION[] = "0.0.1";
const char QNX_BLACKBERRY_CONFIGS_FILENAME[] = "bbndkconfigurations.xml";
+const char QNX_CONFIGS_FILENAME[] = "qnxconfigurations.xml";
const char QNX_DEBUGGING_GROUP[] = "Debugger.Group.Qnx";
diff --git a/src/plugins/qnx/qnxplugin.cpp b/src/plugins/qnx/qnxplugin.cpp
index 2bf3d51f5d..9c8228cfb6 100644
--- a/src/plugins/qnx/qnxplugin.cpp
+++ b/src/plugins/qnx/qnxplugin.cpp
@@ -48,12 +48,14 @@
#include "qnxqtversionfactory.h"
#include "blackberrysetuppage.h"
#include "blackberryndksettingspage.h"
+#include "qnxsettingspage.h"
#include "bardescriptoreditorfactory.h"
#include "bardescriptormagicmatcher.h"
#include "blackberrykeyspage.h"
#include "blackberrycheckdevicestatusstepfactory.h"
#include "blackberrydeviceconnectionmanager.h"
#include "blackberryconfigurationmanager.h"
+#include "qnxconfigurationmanager.h"
#include "blackberryapilevelconfiguration.h"
#include "cascadesimport/cascadesimportwizard.h"
#include "qnxtoolchain.h"
@@ -112,12 +114,14 @@ bool QnxPlugin::initialize(const QStringList &arguments, QString *errorString)
BlackBerryDeviceConnectionManager::instance()->initialize();
// Handles QNX
+ addAutoReleasedObject(new QnxConfigurationManager);
addAutoReleasedObject(new QnxQtVersionFactory);
addAutoReleasedObject(new QnxDeviceConfigurationFactory);
addAutoReleasedObject(new QnxRunControlFactory);
addAutoReleasedObject(new QnxDeployStepFactory);
addAutoReleasedObject(new QnxDeployConfigurationFactory);
addAutoReleasedObject(new QnxRunConfigurationFactory);
+ addAutoReleasedObject(new QnxSettingsPage);
// Handle Qcc Compiler
addAutoReleasedObject(new QnxToolChainFactory);
diff --git a/src/plugins/qnx/qnxsettingspage.cpp b/src/plugins/qnx/qnxsettingspage.cpp
new file mode 100644
index 0000000000..c2949fb6e8
--- /dev/null
+++ b/src/plugins/qnx/qnxsettingspage.cpp
@@ -0,0 +1,76 @@
+/**************************************************************************
+**
+** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
+**
+** Contact: BlackBerry (qt@blackberry.com)
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include "qnxsettingspage.h"
+#include "qnxconfiguration.h"
+#include "qnxconfigurationmanager.h"
+#include "qnxconstants.h"
+
+#include <qnxsettingswidget.h>
+
+#include <coreplugin/icore.h>
+
+#include <QCoreApplication>
+
+#include <QMessageBox>
+
+namespace Qnx {
+namespace Internal {
+
+QnxSettingsPage::QnxSettingsPage(QObject* parent) :
+ Core::IOptionsPage(parent)
+{
+ setId(Core::Id(Constants::QNX_SETTINGS_ID));
+ setDisplayName(tr("QNX"));
+ setCategory(Constants::QNX_CATEGORY);
+ setDisplayCategory(QCoreApplication::translate("QNX",
+ Constants::QNX_CATEGORY_TR));
+ setCategoryIcon(QLatin1String(Constants::QNX_CATEGORY_ICON));
+}
+
+QWidget* QnxSettingsPage::widget()
+{
+ if (!m_widget)
+ m_widget = new QnxSettingsWidget;
+ return m_widget;
+}
+
+void QnxSettingsPage::apply()
+{
+ m_widget->applyChanges();
+}
+
+void QnxSettingsPage::finish()
+{
+ delete m_widget;
+}
+
+}
+}
diff --git a/src/plugins/qnx/qnxsettingspage.h b/src/plugins/qnx/qnxsettingspage.h
new file mode 100644
index 0000000000..1a375f270b
--- /dev/null
+++ b/src/plugins/qnx/qnxsettingspage.h
@@ -0,0 +1,59 @@
+/**************************************************************************
+**
+** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
+**
+** Contact: BlackBerry (qt@blackberry.com)
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#ifndef QNXSETTINGSPAGE_H
+#define QNXSETTINGSPAGE_H
+
+#include <coreplugin/dialogs/ioptionspage.h>
+
+#include <QPointer>
+
+namespace Qnx {
+namespace Internal {
+
+class QnxSettingsWidget;
+
+class QnxSettingsPage : public Core::IOptionsPage
+{
+ Q_OBJECT
+public:
+ explicit QnxSettingsPage(QObject *parent = 0);
+ QWidget *widget();
+ void apply();
+ void finish();
+
+private:
+ QPointer<QnxSettingsWidget> m_widget;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNXSETTINGSPAGE_H
diff --git a/src/plugins/qnx/qnxsettingswidget.cpp b/src/plugins/qnx/qnxsettingswidget.cpp
new file mode 100644
index 0000000000..f5038b0909
--- /dev/null
+++ b/src/plugins/qnx/qnxsettingswidget.cpp
@@ -0,0 +1,221 @@
+/**************************************************************************
+**
+** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
+**
+** Contact: BlackBerry (qt@blackberry.com)
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include "qnxsettingswidget.h"
+#include "ui_qnxsettingswidget.h"
+#include "qnxconfiguration.h"
+#include "qnxconfigurationmanager.h"
+
+#include <qtsupport/qtversionmanager.h>
+#include <coreplugin/icore.h>
+
+#include <QFileDialog>
+#include <QMessageBox>
+
+#include <qdebug.h>
+
+namespace Qnx {
+namespace Internal {
+
+QnxSettingsWidget::QnxSettingsWidget(QWidget *parent) :
+ QWidget(parent),
+ m_ui(new Ui_QnxSettingsWidget),
+ m_qnxConfigManager(QnxConfigurationManager::instance())
+{
+ m_ui->setupUi(this);
+
+ populateConfigsCombo();
+ connect(m_ui->addButton, SIGNAL(clicked()),
+ this, SLOT(addConfiguration()));
+ connect(m_ui->removeButton, SIGNAL(clicked()),
+ this, SLOT(removeConfiguration()));
+ connect(m_ui->configsCombo, SIGNAL(currentIndexChanged(QString)),
+ this, SLOT(updateInformation()));
+ connect(m_ui->generateKitsCheckBox, SIGNAL(toggled(bool)),
+ this, SLOT(generateKits(bool)));
+ connect(m_qnxConfigManager, SIGNAL(configurationsListUpdated()),
+ this, SLOT(populateConfigsCombo()));
+ connect(QtSupport::QtVersionManager::instance(),
+ SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)),
+ this, SLOT(updateInformation()));
+}
+
+QnxSettingsWidget::~QnxSettingsWidget()
+{
+ delete m_ui;
+}
+
+QList<QnxSettingsWidget::ConfigState> QnxSettingsWidget::changedConfigs()
+{
+ return m_changedConfigs;
+}
+
+void QnxSettingsWidget::addConfiguration()
+{
+ QString filter;
+ if (Utils::HostOsInfo::isWindowsHost())
+ filter = QLatin1String("*.bat file");
+ else
+ filter = QLatin1String("*.sh file");
+
+ const QString envFile = QFileDialog::getOpenFileName(this, tr("Select QNX Environment File"),
+ QString(), filter);
+ if (envFile.isEmpty())
+ return;
+
+ QnxConfiguration *config = new QnxConfiguration(Utils::FileName::fromString(envFile));
+ if (m_qnxConfigManager->configurations().contains(config)
+ || !config->isValid()) {
+ QMessageBox::warning(Core::ICore::mainWindow(), tr("Warning"),
+ tr("Configuration already exists or is invalid."));
+ delete config;
+ return;
+ }
+
+ setConfigState(config, State::Added);
+ m_ui->configsCombo->addItem(config->displayName(),
+ QVariant::fromValue(static_cast<void*>(config)));
+}
+
+void QnxSettingsWidget::removeConfiguration()
+{
+ const int currentIndex = m_ui->configsCombo->currentIndex();
+ QnxConfiguration *config = static_cast<QnxConfiguration*>(
+ m_ui->configsCombo->itemData(currentIndex).value<void*>());
+
+ if (!config)
+ return;
+
+ QMessageBox::StandardButton button =
+ QMessageBox::question(Core::ICore::mainWindow(),
+ tr("Remove QNX Configuration"),
+ tr("Are you sure you want to remove:\n %1?").arg(config->displayName()),
+ QMessageBox::Yes | QMessageBox::No);
+
+ if (button == QMessageBox::Yes) {
+ setConfigState(config, State::Removed);
+ m_ui->configsCombo->removeItem(currentIndex);
+ }
+}
+
+void QnxSettingsWidget::generateKits(bool checked)
+{
+ const int currentIndex = m_ui->configsCombo->currentIndex();
+ QnxConfiguration *config = static_cast<QnxConfiguration*>(
+ m_ui->configsCombo->itemData(currentIndex).value<void*>());
+ if (!config)
+ return;
+
+ setConfigState(config, checked ? State::Activated : State::Deactivated);
+}
+
+void QnxSettingsWidget::updateInformation()
+{
+ const int currentIndex = m_ui->configsCombo->currentIndex();
+
+ QnxConfiguration *config = static_cast<QnxConfiguration*>(
+ m_ui->configsCombo->itemData(currentIndex).value<void*>());
+
+ // update the checkbox
+ m_ui->generateKitsCheckBox->setEnabled(config ? config->canCreateKits() : false);
+ m_ui->generateKitsCheckBox->setChecked(config ? config->isActive() : false);
+
+ // update information
+ m_ui->configName->setText(config? config->displayName() : QString());
+ m_ui->configVersion->setText(config ? config->version().toString() : QString());
+ m_ui->configHost->setText(config ? config->qnxHost().toString() : QString());
+ m_ui->configTarget->setText(config ? config->qnxTarget().toString() : QString());
+
+}
+
+void QnxSettingsWidget::populateConfigsCombo()
+{
+ m_ui->configsCombo->clear();
+ foreach (QnxConfiguration *config,
+ m_qnxConfigManager->configurations()) {
+ m_ui->configsCombo->addItem(config->displayName(),
+ QVariant::fromValue(static_cast<void*>(config)));
+ }
+
+ updateInformation();
+}
+
+void QnxSettingsWidget::setConfigState(QnxConfiguration *config,
+ QnxSettingsWidget::State state)
+{
+ QnxSettingsWidget::State stateToRemove;
+ switch (state) {
+ case QnxSettingsWidget::Added :
+ stateToRemove = QnxSettingsWidget::Removed;
+ break;
+ case QnxSettingsWidget::Removed:
+ stateToRemove = QnxSettingsWidget::Added;
+ break;
+ case QnxSettingsWidget::Activated:
+ stateToRemove = QnxSettingsWidget::Deactivated;
+ break;
+ case QnxSettingsWidget::Deactivated:
+ stateToRemove = QnxSettingsWidget::Activated;
+ }
+
+ foreach (const ConfigState &configState, m_changedConfigs) {
+ if (configState.config == config
+ && configState.state == stateToRemove)
+ m_changedConfigs.removeAll(configState);
+ }
+
+ m_changedConfigs.append(ConfigState(config, state));
+}
+
+void QnxSettingsWidget::applyChanges()
+{
+ foreach (const ConfigState &configState, m_changedConfigs) {
+ switch (configState.state) {
+ case State::Activated :
+ configState.config->activate();
+ break;
+ case State::Deactivated:
+ configState.config->deactivate();
+ break;
+ case State::Added:
+ m_qnxConfigManager->addConfiguration(configState.config);
+ break;
+ case State::Removed:
+ configState.config->deactivate();
+ m_qnxConfigManager->removeConfiguration(configState.config);
+ break;
+ }
+ }
+
+ m_changedConfigs.clear();
+}
+
+}
+}
diff --git a/src/plugins/qnx/qnxsettingswidget.h b/src/plugins/qnx/qnxsettingswidget.h
new file mode 100644
index 0000000000..49a8dc3e45
--- /dev/null
+++ b/src/plugins/qnx/qnxsettingswidget.h
@@ -0,0 +1,98 @@
+/**************************************************************************
+**
+** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
+**
+** Contact: BlackBerry (qt@blackberry.com)
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#ifndef QNXSETTINGSWIDGET_H
+#define QNXSETTINGSWIDGET_H
+
+#include <QWidget>
+
+namespace Qnx {
+namespace Internal {
+
+class Ui_QnxSettingsWidget;
+class QnxConfiguration;
+class QnxConfigurationManager;
+
+class QnxSettingsWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ enum State {
+ Activated,
+ Deactivated,
+ Added,
+ Removed
+ };
+
+ class ConfigState {
+ public:
+ ConfigState(QnxConfiguration *config, State state)
+ {
+ this->config = config;
+ this->state = state;
+ }
+
+ bool operator ==(const ConfigState& cs)
+ {
+ return config == cs.config && state == cs.state;
+ }
+
+ QnxConfiguration *config;
+ State state;
+ };
+
+ explicit QnxSettingsWidget(QWidget *parent = 0);
+ ~QnxSettingsWidget();
+ QList<ConfigState> changedConfigs();
+
+protected slots:
+ void addConfiguration();
+ void removeConfiguration();
+ void generateKits(bool checked);
+ void updateInformation();
+ void populateConfigsCombo();
+
+private:
+ Ui_QnxSettingsWidget *m_ui;
+ QnxConfigurationManager *m_qnxConfigManager;
+ QList<ConfigState> m_changedConfigs;
+
+ void setConfigState(QnxConfiguration *config, State state);
+
+ void applyChanges();
+ friend class QnxSettingsPage;
+
+};
+
+}
+}
+
+#endif // QNXSETTINGSWIDGET_H
diff --git a/src/plugins/qnx/qnxsettingswidget.ui b/src/plugins/qnx/qnxsettingswidget.ui
new file mode 100644
index 0000000000..4aa35a0425
--- /dev/null
+++ b/src/plugins/qnx/qnxsettingswidget.ui
@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Qnx::Internal::QnxSettingsWidget</class>
+ <widget class="QWidget" name="Qnx::Internal::QnxSettingsWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>783</width>
+ <height>398</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QComboBox" name="configsCombo"/>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="generateKitsCheckBox">
+ <property name="text">
+ <string>Generate kits</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>Configuration Information:</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Name:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>Version:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_6">
+ <property name="text">
+ <string>Host:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_8">
+ <property name="text">
+ <string>Target:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <item>
+ <widget class="QLabel" name="configName">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="configVersion">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="configHost">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="configTarget">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ <zorder>configName</zorder>
+ <zorder>verticalLayoutWidget</zorder>
+ <zorder>verticalLayoutWidget_2</zorder>
+ <zorder>horizontalSpacer</zorder>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetMaximumSize</enum>
+ </property>
+ <item>
+ <widget class="QPushButton" name="addButton">
+ <property name="text">
+ <string>Add</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="removeButton">
+ <property name="text">
+ <string>Remove</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/plugins/qnx/qnxutils.cpp b/src/plugins/qnx/qnxutils.cpp
index ff7e5c6e08..7dc0afce79 100644
--- a/src/plugins/qnx/qnxutils.cpp
+++ b/src/plugins/qnx/qnxutils.cpp
@@ -186,7 +186,7 @@ Utils::FileName QnxUtils::executableWithExtension(const Utils::FileName &fileNam
return result;
}
-QString QnxUtils::dataDirPath()
+QString QnxUtils::bbDataDirPath()
{
const QString homeDir = QDir::homePath();
@@ -208,17 +208,17 @@ QString QnxUtils::dataDirPath()
return QString();
}
-QString QnxUtils::qConfigPath()
+QString QnxUtils::bbqConfigPath()
{
if (Utils::HostOsInfo::isMacHost() || Utils::HostOsInfo::isWindowsHost())
- return dataDirPath() + QLatin1String("/BlackBerry Native SDK/qconfig");
+ return bbDataDirPath() + QLatin1String("/BlackBerry Native SDK/qconfig");
else
- return dataDirPath() + QLatin1String("/bbndk/qconfig");
+ return bbDataDirPath() + QLatin1String("/bbndk/qconfig");
}
QString QnxUtils::defaultTargetVersion(const QString &ndkPath)
{
- foreach (const NdkInstallInformation &ndkInfo, installedNdks()) {
+ foreach (const ConfigInstallInformation &ndkInfo, installedConfigs()) {
if (!ndkInfo.path.compare(ndkPath, Utils::HostOsInfo::fileNameCaseSensitivity()))
return ndkInfo.version;
}
@@ -226,10 +226,13 @@ QString QnxUtils::defaultTargetVersion(const QString &ndkPath)
return QString();
}
-QList<NdkInstallInformation> QnxUtils::installedNdks()
+QList<ConfigInstallInformation> QnxUtils::installedConfigs(const QString &configPath)
{
- QList<NdkInstallInformation> ndkList;
- QString ndkConfigPath = qConfigPath();
+ QList<ConfigInstallInformation> ndkList;
+ QString ndkConfigPath = configPath;
+ if (ndkConfigPath.isEmpty())
+ ndkConfigPath = bbqConfigPath();
+
if (!QDir(ndkConfigPath).exists())
return ndkList;
@@ -252,7 +255,7 @@ QList<NdkInstallInformation> QnxUtils::installedNdks()
// The file contains only one installation node
if (!childElt.isNull()) {
// The file contains only one base node
- NdkInstallInformation ndkInfo;
+ ConfigInstallInformation ndkInfo;
ndkInfo.path = childElt.firstChildElement(QLatin1String("base")).text();
ndkInfo.name = childElt.firstChildElement(QLatin1String("name")).text();
ndkInfo.host = childElt.firstChildElement(QLatin1String("host")).text();
diff --git a/src/plugins/qnx/qnxutils.h b/src/plugins/qnx/qnxutils.h
index 33b1b3e314..963d130fc4 100644
--- a/src/plugins/qnx/qnxutils.h
+++ b/src/plugins/qnx/qnxutils.h
@@ -46,7 +46,7 @@ namespace Internal {
class QnxAbstractQtVersion;
-class NdkInstallInformation
+class ConfigInstallInformation
{
public:
QString path;
@@ -70,10 +70,10 @@ public:
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 dataDirPath();
- static QString qConfigPath();
+ static QString bbDataDirPath();
+ static QString bbqConfigPath();
static QString defaultTargetVersion(const QString& ndkPath);
- static QList<NdkInstallInformation> installedNdks();
+ static QList<ConfigInstallInformation> installedConfigs(const QString &configPath = QString());
static QString sdkInstallerPath(const QString& ndkPath);
static QString qdeInstallProcess(const QString& ndkPath, const QString &target,
const QString &option, const QString &version = QString());
diff --git a/src/plugins/qnx/blackberryversionnumber.cpp b/src/plugins/qnx/qnxversionnumber.cpp
index 89f56a2886..15650ac82a 100644
--- a/src/plugins/qnx/blackberryversionnumber.cpp
+++ b/src/plugins/qnx/qnxversionnumber.cpp
@@ -29,7 +29,7 @@
**
****************************************************************************/
-#include "blackberryversionnumber.h"
+#include "qnxversionnumber.h"
#include <QDir>
@@ -38,26 +38,26 @@ namespace Internal {
static const char NONDIGIT_SEGMENT_REGEXP[] = "(?<=\\d)(?=\\D)|(?<=\\D)(?=\\d)";
-BlackBerryVersionNumber::BlackBerryVersionNumber(const QStringList &listNumber)
+QnxVersionNumber::QnxVersionNumber(const QStringList &listNumber)
: m_segments(listNumber)
{
}
-BlackBerryVersionNumber::BlackBerryVersionNumber(const QString &version)
+QnxVersionNumber::QnxVersionNumber(const QString &version)
{
m_segments = version.split(QLatin1Char('.'));
}
-BlackBerryVersionNumber::BlackBerryVersionNumber()
+QnxVersionNumber::QnxVersionNumber()
{
}
-QString BlackBerryVersionNumber::toString() const
+QString QnxVersionNumber::toString() const
{
return m_segments.join(QLatin1String("."));
}
-bool BlackBerryVersionNumber::operator >(const BlackBerryVersionNumber &b) const
+bool QnxVersionNumber::operator >(const QnxVersionNumber &b) const
{
int minSize = size() > b.size() ? b.size() : size();
for (int i = 0; i < minSize; i++) {
@@ -84,7 +84,7 @@ bool BlackBerryVersionNumber::operator >(const BlackBerryVersionNumber &b) const
return false;
}
-QString BlackBerryVersionNumber::segment(int index) const
+QString QnxVersionNumber::segment(int index) const
{
if (index < m_segments.length())
return m_segments.at(index);
@@ -92,31 +92,31 @@ QString BlackBerryVersionNumber::segment(int index) const
return QString();
}
-BlackBerryVersionNumber BlackBerryVersionNumber::fromNdkEnvFileName(const QString &ndkEnvFileName)
+QnxVersionNumber QnxVersionNumber::fromNdkEnvFileName(const QString &ndkEnvFileName)
{
return fromFileName(ndkEnvFileName, QRegExp(QLatin1String("^bbndk-env_(.*)$")));
}
-BlackBerryVersionNumber BlackBerryVersionNumber::fromTargetName(const QString &targetName)
+QnxVersionNumber QnxVersionNumber::fromTargetName(const QString &targetName)
{
return fromFileName(targetName, QRegExp(QLatin1String("^target_(.*)$")));
}
-BlackBerryVersionNumber BlackBerryVersionNumber::fromFileName(const QString &fileName, const QRegExp &regExp)
+QnxVersionNumber QnxVersionNumber::fromFileName(const QString &fileName, const QRegExp &regExp)
{
QStringList segments;
if (regExp.exactMatch(fileName) && regExp.captureCount() == 1)
segments << regExp.cap(1).split(QLatin1Char('_'));
- return BlackBerryVersionNumber(segments);
+ return QnxVersionNumber(segments);
}
-int BlackBerryVersionNumber::size() const
+int QnxVersionNumber::size() const
{
return m_segments.length();
}
-bool BlackBerryVersionNumber::isEmpty() const
+bool QnxVersionNumber::isEmpty() const
{
return m_segments.isEmpty();
}
diff --git a/src/plugins/qnx/blackberryversionnumber.h b/src/plugins/qnx/qnxversionnumber.h
index 86cf272b75..db1e5a2cdb 100644
--- a/src/plugins/qnx/blackberryversionnumber.h
+++ b/src/plugins/qnx/qnxversionnumber.h
@@ -29,30 +29,30 @@
**
****************************************************************************/
-#ifndef BLACKBERRY_VERSION_NUMBER_H
-#define BLACKBERRY_VERSION_NUMBER_H
+#ifndef QNX_VERSION_NUMBER_H
+#define QNX_VERSION_NUMBER_H
#include <QStringList>
namespace Qnx {
namespace Internal {
-class BlackBerryVersionNumber
+class QnxVersionNumber
{
public:
- BlackBerryVersionNumber(const QStringList &segments);
- BlackBerryVersionNumber(const QString &version);
- BlackBerryVersionNumber();
+ QnxVersionNumber(const QStringList &segments);
+ QnxVersionNumber(const QString &version);
+ QnxVersionNumber();
int size() const;
bool isEmpty() const;
QString segment(int index) const;
QString toString() const;
- static BlackBerryVersionNumber fromNdkEnvFileName(const QString &ndkEnvFileName);
- static BlackBerryVersionNumber fromTargetName(const QString &targetName);
- static BlackBerryVersionNumber fromFileName(const QString &fileName, const QRegExp &regExp);
+ static QnxVersionNumber fromNdkEnvFileName(const QString &ndkEnvFileName);
+ static QnxVersionNumber fromTargetName(const QString &targetName);
+ static QnxVersionNumber fromFileName(const QString &fileName, const QRegExp &regExp);
- bool operator >(const BlackBerryVersionNumber &b) const;
+ bool operator >(const QnxVersionNumber &b) const;
private:
QStringList m_segments;
@@ -61,4 +61,4 @@ private:
} // namespace Internal
} // namespace Qnx
-#endif // VERSIONNUMBER_H
+#endif // QNX_VERSION_NUMBER_H