ProjectExplorer: And more Key and Store

Change-Id: Id5787890bdb46bfeef8e3f37923e6dc26cb56c31
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
hjk
2023-08-24 12:41:45 +02:00
parent 16454e13eb
commit 6c2864bd4b
27 changed files with 306 additions and 314 deletions

View File

@@ -91,9 +91,9 @@ void CustomParserExpression::setMessageCap(int messageCap)
m_messageCap = messageCap;
}
QVariantMap CustomParserExpression::toMap() const
Store CustomParserExpression::toMap() const
{
QVariantMap map;
Store map;
map.insert(patternKey, pattern());
map.insert(messageCapKey, messageCap());
map.insert(fileNameCapKey, fileNameCap());
@@ -139,22 +139,22 @@ bool CustomParserSettings::operator ==(const CustomParserSettings &other) const
&& error == other.error && warning == other.warning;
}
QVariantMap CustomParserSettings::toMap() const
Store CustomParserSettings::toMap() const
{
QVariantMap map;
Store map;
map.insert(idKey, id.toSetting());
map.insert(nameKey, displayName);
map.insert(errorKey, error.toMap());
map.insert(warningKey, warning.toMap());
map.insert(errorKey, QVariant::fromValue(error.toMap()));
map.insert(warningKey, QVariant::fromValue(warning.toMap()));
return map;
}
void CustomParserSettings::fromMap(const Store &map)
{
id = Utils::Id::fromSetting(map.value(idKey));
id = Id::fromSetting(map.value(idKey));
displayName = map.value(nameKey).toString();
error.fromMap(map.value(errorKey).toMap());
warning.fromMap(map.value(warningKey).toMap());
error.fromMap(map.value(errorKey).value<Store>());
warning.fromMap(map.value(warningKey).value<Store>());
}
CustomParsersAspect::CustomParsersAspect(Target *target)
@@ -175,12 +175,12 @@ CustomParsersAspect::CustomParsersAspect(Target *target)
void CustomParsersAspect::fromMap(const Store &map)
{
m_parsers = transform(map.value(settingsKey()).toList(), &Utils::Id::fromSetting);
m_parsers = transform(map.value(settingsKey()).toList(), &Id::fromSetting);
}
void CustomParsersAspect::toMap(Store &map) const
{
map.insert(settingsKey(), transform(m_parsers, &Utils::Id::toSetting));
map.insert(settingsKey(), transform(m_parsers, &Id::toSetting));
}
namespace Internal {