Analyzers: Re-enable switch between global and project settings

This was apparently always using project settings for a while,
even when "Use Global Settings" were selected in the Run settings.

Change-Id: I1293a617edcbfd6bc47c57102fa53096c717ec4e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-02-18 07:18:40 +01:00
parent 31d3e3252f
commit 6bba37ab16
3 changed files with 13 additions and 1 deletions

View File

@@ -134,6 +134,16 @@ void GlobalOrProjectAspect::toMap(QVariantMap &map) const
map.insert(id().toString() + ".UseGlobalSettings", m_useGlobalSettings);
}
void GlobalOrProjectAspect::toActiveMap(QVariantMap &data) const
{
if (m_useGlobalSettings)
m_globalSettings->toMap(data);
else if (m_projectSettings)
m_projectSettings->toMap(data);
else
QTC_CHECK(false);
}
void GlobalOrProjectAspect::resetProjectToGlobalSettings()
{
QTC_ASSERT(m_globalSettings, return);
@@ -235,7 +245,7 @@ QMap<Utils::Id, QVariantMap> RunConfiguration::aspectData() const
{
QMap<Utils::Id, QVariantMap> data;
for (BaseAspect *aspect : qAsConst(m_aspects))
aspect->toMap(data[aspect->id()]);
aspect->toActiveMap(data[aspect->id()]);
return data;
}