diff options
author | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2015-04-30 12:54:48 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2015-05-04 13:49:19 +0000 |
commit | 5aba7fb09504e1a08e25c0a5f388f8108c472b05 (patch) | |
tree | 41a5ac206ff9f70603266de8ac09d31d7272d3aa | |
parent | 3bbc83addc26d5c8003f7a440f27540a99e2ff57 (diff) | |
download | qt-creator-5aba7fb09504e1a08e25c0a5f388f8108c472b05.tar.gz |
Sdktool: Fix default kit handling
The default kit is addressed by its id, not its number for a long
time now. Update sdktool accordingly.
Change-Id: Iad0d0c6eda2aa824fa8add99871db7efebb30e75
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Rainer Keller <rainer.keller@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
-rw-r--r-- | src/tools/sdktool/addkitoperation.cpp | 17 | ||||
-rw-r--r-- | src/tools/sdktool/addtoolchainoperation.cpp | 2 |
2 files changed, 7 insertions, 12 deletions
diff --git a/src/tools/sdktool/addkitoperation.cpp b/src/tools/sdktool/addkitoperation.cpp index 75100f7c02..818869686d 100644 --- a/src/tools/sdktool/addkitoperation.cpp +++ b/src/tools/sdktool/addkitoperation.cpp @@ -289,7 +289,7 @@ bool AddKitOperation::test() const || !map.contains(QLatin1String(COUNT)) || map.value(QLatin1String(COUNT)).toInt() != 0 || !map.contains(QLatin1String(DEFAULT)) - || map.value(QLatin1String(DEFAULT)).toInt() != -1) + || !map.value(QLatin1String(DEFAULT)).toString().isEmpty()) return false; // Fail if TC is not there: @@ -352,7 +352,7 @@ bool AddKitOperation::test() const || !map.contains(QLatin1String(COUNT)) || map.value(QLatin1String(COUNT)).toInt() != 1 || !map.contains(QLatin1String(DEFAULT)) - || map.value(QLatin1String(DEFAULT)).toInt() != 0 + || map.value(QLatin1String(DEFAULT)).toString() != QLatin1String("testId") || !map.contains(QLatin1String("Profile.0"))) return false; @@ -571,14 +571,9 @@ QVariantMap AddKitOperation::addKit(const QVariantMap &map, const QVariantMap &t } const QString kit = QString::fromLatin1(PREFIX) + QString::number(count); - int defaultKit = GetOperation::get(map, QLatin1String(DEFAULT)).toInt(&ok); - if (!ok) { - std::cerr << "Error: Default kit seems wrong." << std::endl; - return QVariantMap(); - } - - if (defaultKit < 0) - defaultKit = 0; + QString defaultKit = GetOperation::get(map, QLatin1String(DEFAULT)).toString(); + if (defaultKit.isEmpty()) + defaultKit = id; // remove data: QStringList toRemove; @@ -645,7 +640,7 @@ QVariantMap AddKitOperation::initializeKits() { QVariantMap map; map.insert(QLatin1String(VERSION), 1); - map.insert(QLatin1String(DEFAULT), -1); + map.insert(QLatin1String(DEFAULT), QString()); map.insert(QLatin1String(COUNT), 0); return map; } diff --git a/src/tools/sdktool/addtoolchainoperation.cpp b/src/tools/sdktool/addtoolchainoperation.cpp index 80d7942424..a3003f3dee 100644 --- a/src/tools/sdktool/addtoolchainoperation.cpp +++ b/src/tools/sdktool/addtoolchainoperation.cpp @@ -251,7 +251,7 @@ QVariantMap AddToolChainOperation::addToolChain(const QVariantMap &map, const QString tc = QString::fromLatin1(PREFIX) + QString::number(count); KeyValuePairList data; - data << KeyValuePair(QStringList() << tc << QLatin1String(ID), QVariant(id.toUtf8())); + data << KeyValuePair(QStringList() << tc << QLatin1String(ID), QVariant(id)); data << KeyValuePair(QStringList() << tc << QLatin1String(DISPLAYNAME), QVariant(uniqueName)); data << KeyValuePair(QStringList() << tc << QLatin1String(AUTODETECTED), QVariant(true)); data << KeyValuePair(QStringList() << tc << QLatin1String(PATH), QVariant(path)); |