CMake: Make fromMap more robust for CMakeBuildConfigurations

Do not add broken configuration items read in from the .user file.

Change-Id: Ia4372d040456252fdd0750b597777979ad568ca6
Reviewed-by: Vikas Pachdha <vikas.pachdha@theqtcompany.com>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2016-04-08 14:11:57 +02:00
parent badd6d0125
commit 51a6dadc77

View File

@@ -105,8 +105,9 @@ bool CMakeBuildConfiguration::fromMap(const QVariantMap &map)
return false;
const CMakeConfig conf
= Utils::transform(map.value(QLatin1String(CONFIGURATION_KEY)).toStringList(),
[](const QString &v) { return CMakeConfigItem::fromString(v); });
= Utils::filtered(Utils::transform(map.value(QLatin1String(CONFIGURATION_KEY)).toStringList(),
[](const QString &v) { return CMakeConfigItem::fromString(v); }),
[](const CMakeConfigItem &c) { return !c.isNull(); });
// Legacy (pre QtC 3.7):
const QStringList args = QtcProcess::splitArgs(map.value(QLatin1String(INITIAL_ARGUMENTS)).toString());