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:
Tobias Hunger
2013-02-22 13:57:00 +01:00
parent 88fe1ce5b7
commit fcb1693e83
7 changed files with 18 additions and 18 deletions

View File

@@ -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

View File

@@ -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,
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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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