forked from qt-creator/qt-creator
SDKtool: Fix removal of toolchains
Change-Id: If66745582adcae1dbdb101cecc426280c1be182f Reviewed-by: Rainer Keller <rainer.keller@digia.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -81,12 +81,12 @@ int AddKeysOperation::execute() const
|
||||
|
||||
QVariantMap map = load(m_file);
|
||||
|
||||
map = addKeys(map, m_data);
|
||||
if (map.isEmpty())
|
||||
QVariantMap result = addKeys(map, m_data);
|
||||
if (map.isEmpty() || map == result)
|
||||
return -4;
|
||||
|
||||
// Write data again:
|
||||
return save(map, m_file) ? 0 : -5;
|
||||
return save(result, m_file) ? 0 : -5;
|
||||
}
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
|
||||
@@ -214,13 +214,13 @@ int AddKitOperation::execute() const
|
||||
if (map.isEmpty())
|
||||
map = initializeKits();
|
||||
|
||||
map = addKit(map, m_id, m_displayName, m_icon, m_debuggerEngine, m_debugger,
|
||||
m_deviceType.toUtf8(), m_sysRoot, m_tc, m_qt, m_mkspec, m_extra);
|
||||
QVariantMap result = addKit(map, m_id, m_displayName, m_icon, m_debuggerEngine, m_debugger,
|
||||
m_deviceType.toUtf8(), m_sysRoot, m_tc, m_qt, m_mkspec, m_extra);
|
||||
|
||||
if (map.isEmpty())
|
||||
if (map.isEmpty() || map == result)
|
||||
return -2;
|
||||
|
||||
return save(map, QLatin1String("profiles")) ? 0 : -3;
|
||||
return save(result, QLatin1String("profiles")) ? 0 : -3;
|
||||
}
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
|
||||
@@ -152,12 +152,12 @@ int AddQtOperation::execute() const
|
||||
if (map.isEmpty())
|
||||
map = initializeQtVersions();
|
||||
|
||||
map = addQt(map, m_id, m_displayName, m_type, m_qmake, m_extra);
|
||||
QVariantMap result = addQt(map, m_id, m_displayName, m_type, m_qmake, m_extra);
|
||||
|
||||
if (map.isEmpty())
|
||||
if (map.isEmpty() || result == map)
|
||||
return -2;
|
||||
|
||||
return save(map, QLatin1String("qtversions")) ? 0 : -3;
|
||||
return save(result, QLatin1String("qtversions")) ? 0 : -3;
|
||||
}
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
|
||||
@@ -149,11 +149,11 @@ int AddToolChainOperation::execute() const
|
||||
if (map.isEmpty())
|
||||
map = initializeToolChains();
|
||||
|
||||
map = addToolChain(map, m_id, m_displayName, m_path, m_targetAbi, m_supportedAbis, m_extra);
|
||||
if (map.isEmpty())
|
||||
QVariantMap result = addToolChain(map, m_id, m_displayName, m_path, m_targetAbi, m_supportedAbis, m_extra);
|
||||
if (map.isEmpty() || map == result)
|
||||
return -2;
|
||||
|
||||
return save(map, QLatin1String("toolchains")) ? 0 : -3;
|
||||
return save(result, QLatin1String("toolchains")) ? 0 : -3;
|
||||
}
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
|
||||
@@ -72,7 +72,7 @@ int RmKeysOperation::execute() const
|
||||
return 1;
|
||||
|
||||
// Write data again:
|
||||
return save(map, m_file) ? 0 : 2;
|
||||
return save(result, m_file) ? 0 : 2;
|
||||
}
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
|
||||
@@ -87,12 +87,12 @@ int RmKitOperation::execute() const
|
||||
if (map.isEmpty())
|
||||
map = AddKitOperation::initializeKits();
|
||||
|
||||
map = rmKit(map, m_id);
|
||||
QVariantMap result = rmKit(map, m_id);
|
||||
|
||||
if (map.isEmpty())
|
||||
if (result.isEmpty() || result == map)
|
||||
return -2;
|
||||
|
||||
return save(map, QLatin1String("profiles")) ? 0 : -3;
|
||||
return save(result, QLatin1String("profiles")) ? 0 : -3;
|
||||
}
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
|
||||
@@ -93,7 +93,7 @@ int RmToolChainOperation::execute() const
|
||||
if (result == map)
|
||||
return -2;
|
||||
|
||||
return save(map, QLatin1String("toolchains")) ? 0 : -3;
|
||||
return save(result, QLatin1String("toolchains")) ? 0 : -3;
|
||||
}
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
|
||||
Reference in New Issue
Block a user