summaryrefslogtreecommitdiff
path: root/src/plugins/qnx/qnxutils.cpp
diff options
context:
space:
mode:
authorMehdi Fekari <mfekari@rim.com>2013-07-04 16:21:33 +0200
committerMehdi Fekari <mfekari@blackberry.com>2013-07-24 18:20:23 +0200
commit7b313e9696e789e8b20c2ef53cc12c2da522a2d5 (patch)
treef5957b204dbb7c93e09e2a2c8c9c88a17ce0e3a7 /src/plugins/qnx/qnxutils.cpp
parent2ac65aaa7ca509fbfd82a32f0ee5367ca63738e1 (diff)
downloadqt-creator-7b313e9696e789e8b20c2ef53cc12c2da522a2d5.tar.gz
Qnx: Refactor BlackBerryConfiguration
Improve the NDK setting page to enable managing multiple NDKs. * Refactor BlackBerryConfiguration to support multiple configurations * Add auto detected kits for installed NDKs * Add/Remove manual NDKs Change-Id: Icbc850551da3f729ccaa3473da720ade3051adaf Reviewed-by: Tobias Hunger <tobias.hunger@digia.com> Reviewed-by: Wolfgang Bremer <wbremer@blackberry.com>
Diffstat (limited to 'src/plugins/qnx/qnxutils.cpp')
-rw-r--r--src/plugins/qnx/qnxutils.cpp26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/plugins/qnx/qnxutils.cpp b/src/plugins/qnx/qnxutils.cpp
index 2da2c9bc19..0c7de30c43 100644
--- a/src/plugins/qnx/qnxutils.cpp
+++ b/src/plugins/qnx/qnxutils.cpp
@@ -262,9 +262,20 @@ QString QnxUtils::qConfigPath()
QString QnxUtils::ndkVersion(const QString &ndkPath)
{
+ foreach (const NdkInstallInformation &ndkInfo, installedNdks()) {
+ if (!ndkInfo.path.compare(ndkPath, Utils::HostOsInfo::fileNameCaseSensitivity()))
+ return ndkInfo.version;
+ }
+
+ return QString();
+}
+
+QList<NdkInstallInformation> QnxUtils::installedNdks()
+{
+ QList<NdkInstallInformation> ndkList;
QString ndkConfigPath = qConfigPath();
if (!QDir(ndkConfigPath).exists())
- return QString();
+ return ndkList;
QFileInfoList ndkfileList = QDir(ndkConfigPath).entryInfoList(QStringList() << QLatin1String("*.xml"),
QDir::Files, QDir::Time);
@@ -285,11 +296,16 @@ QString QnxUtils::ndkVersion(const QString &ndkPath)
// The file contains only one installation node
if (!childElt.isNull()) {
// The file contains only one base node
- QDomElement elt = childElt.firstChildElement(QLatin1String("base"));
- if (!elt.text().compare(ndkPath, Utils::HostOsInfo::fileNameCaseSensitivity()))
- return childElt.firstChildElement(QLatin1String("version")).text();
+ NdkInstallInformation ndkInfo;
+ ndkInfo.path = childElt.firstChildElement(QLatin1String("base")).text();
+ ndkInfo.name = childElt.firstChildElement(QLatin1String("name")).text();
+ ndkInfo.host = childElt.firstChildElement(QLatin1String("host")).text();
+ ndkInfo.target = childElt.firstChildElement(QLatin1String("target")).text();
+ ndkInfo.version = childElt.firstChildElement(QLatin1String("version")).text();
+
+ ndkList.append(ndkInfo);
}
}
- return QString();
+ return ndkList;
}