SDKTool: Allow for explicitly unsetting Qt in addKitOperation

Treat a empty string passed in as argument to --qt as "No Qt" by
forcing that to "-1".

Fixes: QTCREATORBUG-23168
Change-Id: I03c536d0cc0f7bc2ad291a2bbcc5297df509b524
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Tobias Hunger
2019-12-06 11:27:56 +01:00
parent 3c41b91d44
commit 56b82c41c4

View File

@@ -602,6 +602,11 @@ QVariantMap AddKitOperation::addKit(const QVariantMap &map, const QVariantMap &t
std::cerr << "Error: Device " << qPrintable(device) << " does not exist." << std::endl; std::cerr << "Error: Device " << qPrintable(device) << " does not exist." << std::endl;
return QVariantMap(); return QVariantMap();
} }
// Treat a qt that was explicitly set to '' as "no Qt"
if (!qtId.isNull() && qtId.isEmpty())
qtId = "-1";
if (!cmakeId.isEmpty() && !AddCMakeOperation::exists(cmakeMap, cmakeId)) { if (!cmakeId.isEmpty() && !AddCMakeOperation::exists(cmakeMap, cmakeId)) {
std::cerr << "Error: CMake tool " << qPrintable(cmakeId) << " does not exist." << std::endl; std::cerr << "Error: CMake tool " << qPrintable(cmakeId) << " does not exist." << std::endl;
return QVariantMap(); return QVariantMap();