diff options
author | Tobias Hunger <tobias.hunger@digia.com> | 2014-04-09 15:15:02 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@digia.com> | 2014-04-09 17:14:14 +0200 |
commit | 966f2aebc4ea67c8445dbf299138cf3fee1c8cf9 (patch) | |
tree | 059d06208e82528a270349e2ec8f15f0645397d1 /src/tools/sdktool | |
parent | 8095a212b378d165712766377926434038f0948d (diff) | |
download | qt-creator-966f2aebc4ea67c8445dbf299138cf3fee1c8cf9.tar.gz |
SDKtool: Only write values into kit that were set on the commandline
Do not put empty values for settings into the kits: These will prevent
data from being editable in Qt Creator.
Task-number: QTCREATORBUG-12017
Change-Id: I10f67ed0038ba7e1a79cbf7b5658247a2d18b8eb
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Diffstat (limited to 'src/tools/sdktool')
-rw-r--r-- | src/tools/sdktool/addkitoperation.cpp | 80 |
1 files changed, 55 insertions, 25 deletions
diff --git a/src/tools/sdktool/addkitoperation.cpp b/src/tools/sdktool/addkitoperation.cpp index 5bb87326db..1aab466b35 100644 --- a/src/tools/sdktool/addkitoperation.cpp +++ b/src/tools/sdktool/addkitoperation.cpp @@ -372,9 +372,19 @@ bool AddKitOperation::test() const return false; QVariantMap data = profile0.value(QLatin1String(DATA)).toMap(); - if (data.count() != 8 + if (data.count() != 6 || !data.contains(QLatin1String(DEBUGGER)) - || data.value(QLatin1String(DEBUGGER)).type()!= QVariant::Map) + || data.value(QLatin1String(DEBUGGER)).type() != QVariant::Map + || !data.contains(QLatin1String(DEVICE_TYPE)) + || data.value(QLatin1String(DEVICE_TYPE)).toString() != QLatin1String("Desktop") + || !data.contains(QLatin1String(TOOLCHAIN)) + || data.value(QLatin1String(TOOLCHAIN)).toString() != QLatin1String("{tc-id}") + || !data.contains(QLatin1String(QT)) + || data.value(QLatin1String(QT)).toString() != QLatin1String("SDK.{qt-id}") + || !data.contains(QLatin1String(MKSPEC)) + || data.value(QLatin1String(MKSPEC)).toString() != QLatin1String("unsupported/mkspec") + || !data.contains(QLatin1String("extraData")) + || data.value(QLatin1String("extraData")).toString() != QLatin1String("extraValue")) return false; // Ignore existing ids: @@ -391,7 +401,7 @@ bool AddKitOperation::test() const map = addKit(map, tcMap, qtMap, devMap, QLatin1String("testId2"), QLatin1String("Test Kit2"), QLatin1String("/tmp/icon2.png"), QString(), 1, QLatin1String("/usr/bin/gdb-test2"), - QByteArray("Desktop"), QLatin1String("{dev-id}"), QString(), + QByteArray("Desktop"), QLatin1String("{dev-id}"), QLatin1String("/sys/root\\\\"), QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"), KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); if (map.count() != 5 @@ -425,10 +435,22 @@ bool AddKitOperation::test() const data = profile1.value(QLatin1String(DATA)).toMap(); if (data.count() != 8 + || !data.contains(QLatin1String(DEBUGGER)) + || data.value(QLatin1String(DEBUGGER)).type() != QVariant::Map + || !data.contains(QLatin1String(DEVICE_TYPE)) + || data.value(QLatin1String(DEVICE_TYPE)).toString() != QLatin1String("Desktop") || !data.contains(QLatin1String(DEVICE_ID)) || data.value(QLatin1String(DEVICE_ID)).toString() != QLatin1String("{dev-id}") - || !data.contains(QLatin1String(DEBUGGER)) - || data.value(QLatin1String(DEBUGGER)).type() != QVariant::Map) + || !data.contains(QLatin1String(SYSROOT)) + || data.value(QLatin1String(SYSROOT)).toString() != QLatin1String("/sys/root\\\\") + || !data.contains(QLatin1String(TOOLCHAIN)) + || data.value(QLatin1String(TOOLCHAIN)).toString() != QLatin1String("{tc-id}") + || !data.contains(QLatin1String(QT)) + || data.value(QLatin1String(QT)).toString() != QLatin1String("SDK.{qt-id}") + || !data.contains(QLatin1String(MKSPEC)) + || data.value(QLatin1String(MKSPEC)).toString() != QLatin1String("unsupported/mkspec") + || !data.contains(QLatin1String("extraData")) + || data.value(QLatin1String("extraData")).toString() != QLatin1String("extraValue")) return false; // Test debugger id: @@ -471,7 +493,7 @@ bool AddKitOperation::test() const return false; data = profile2.value(QLatin1String(DATA)).toMap(); - if (data.count() != 8 + if (data.count() != 6 || !data.contains(QLatin1String(DEBUGGER)) || data.value(QLatin1String(DEBUGGER)).toString() != QLatin1String("debugger Id")) return false; @@ -577,27 +599,35 @@ QVariantMap AddKitOperation::addKit(const QVariantMap &map, const QVariantMap &t data << KeyValuePair(QStringList() << kit << QLatin1String(AUTODETECTED), QVariant(true)); data << KeyValuePair(QStringList() << kit << QLatin1String(SDK), QVariant(true)); - if (debuggerId.isEmpty()) { + if (!debuggerId.isNull() || !debugger.isNull()) { + if (debuggerId.isEmpty()) { + data << KeyValuePair(QStringList() << kit << QLatin1String(DATA) + << QLatin1String(DEBUGGER) << QLatin1String(DEBUGGER_ENGINE), QVariant(debuggerType)); + data << KeyValuePair(QStringList() << kit << QLatin1String(DATA) + << QLatin1String(DEBUGGER) << QLatin1String(DEBUGGER_BINARY), QVariant(debugger)); + } else { + data << KeyValuePair(QStringList() << kit << QLatin1String(DATA) << QLatin1String(DEBUGGER), + QVariant(debuggerId)); + } + } + if (!deviceType.isNull()) data << KeyValuePair(QStringList() << kit << QLatin1String(DATA) - << QLatin1String(DEBUGGER) << QLatin1String(DEBUGGER_ENGINE), QVariant(debuggerType)); + << QLatin1String(DEVICE_TYPE), QVariant(deviceType)); + if (!device.isNull()) data << KeyValuePair(QStringList() << kit << QLatin1String(DATA) - << QLatin1String(DEBUGGER) << QLatin1String(DEBUGGER_BINARY), QVariant(debugger)); - } else { - data << KeyValuePair(QStringList() << kit << QLatin1String(DATA) << QLatin1String(DEBUGGER), - QVariant(debuggerId)); - } - data << KeyValuePair(QStringList() << kit << QLatin1String(DATA) - << QLatin1String(DEVICE_TYPE), QVariant(deviceType)); - data << KeyValuePair(QStringList() << kit << QLatin1String(DATA) - << QLatin1String(DEVICE_ID), QVariant(device)); - data << KeyValuePair(QStringList() << kit << QLatin1String(DATA) - << QLatin1String(SYSROOT), QVariant(sysRoot)); - data << KeyValuePair(QStringList() << kit << QLatin1String(DATA) - << QLatin1String(TOOLCHAIN), QVariant(tc)); - data << KeyValuePair(QStringList() << kit << QLatin1String(DATA) - << QLatin1String(QT), QVariant(qtId)); - data << KeyValuePair(QStringList() << kit << QLatin1String(DATA) - << QLatin1String(MKSPEC), QVariant(mkspec)); + << QLatin1String(DEVICE_ID), QVariant(device)); + if (!sysRoot.isNull()) + data << KeyValuePair(QStringList() << kit << QLatin1String(DATA) + << QLatin1String(SYSROOT), QVariant(sysRoot)); + if (!tc.isNull()) + data << KeyValuePair(QStringList() << kit << QLatin1String(DATA) + << QLatin1String(TOOLCHAIN), QVariant(tc)); + if (!qtId.isNull()) + data << KeyValuePair(QStringList() << kit << QLatin1String(DATA) + << QLatin1String(QT), QVariant(qtId)); + if (!mkspec.isNull()) + data << KeyValuePair(QStringList() << kit << QLatin1String(DATA) + << QLatin1String(MKSPEC), QVariant(mkspec)); data << KeyValuePair(QStringList() << QLatin1String(DEFAULT), QVariant(defaultKit)); data << KeyValuePair(QStringList() << QLatin1String(COUNT), QVariant(count + 1)); |