[libcalamaresui] Don't clear the map when inserting strings

- the documentation doesn't say the map is cleared, and the one
  place this function is used doesn't need that either.
- make type of config explicit
This commit is contained in:
Adriaan de Groot 2020-07-09 08:45:41 +02:00
parent a91edfef89
commit da1cc7c3a5

View File

@ -132,9 +132,7 @@ loadStrings( QMap< QString, QString >& map,
throw YAML::Exception( YAML::Mark(), std::string( "Branding configuration is not a map: " ) + key );
}
const auto& config = CalamaresUtils::yamlMapToVariant( doc[ key ] );
map.clear();
const QVariantMap config = CalamaresUtils::yamlMapToVariant( doc[ key ] );
for ( auto it = config.constBegin(); it != config.constEnd(); ++it )
{
map.insert( it.key(), transform( it.value().toString() ) );