forked from qt-creator/qt-creator
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:
@@ -97,6 +97,7 @@ public:
|
|||||||
|
|
||||||
virtual void fromMap(const QVariantMap &map);
|
virtual void fromMap(const QVariantMap &map);
|
||||||
virtual void toMap(QVariantMap &map) const;
|
virtual void toMap(QVariantMap &map) const;
|
||||||
|
virtual void toActiveMap(QVariantMap &map) const { toMap(map); }
|
||||||
virtual void acquaintSiblings(const BaseAspects &);
|
virtual void acquaintSiblings(const BaseAspects &);
|
||||||
|
|
||||||
virtual void addToLayout(LayoutBuilder &builder);
|
virtual void addToLayout(LayoutBuilder &builder);
|
||||||
|
@@ -134,6 +134,16 @@ void GlobalOrProjectAspect::toMap(QVariantMap &map) const
|
|||||||
map.insert(id().toString() + ".UseGlobalSettings", m_useGlobalSettings);
|
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()
|
void GlobalOrProjectAspect::resetProjectToGlobalSettings()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_globalSettings, return);
|
QTC_ASSERT(m_globalSettings, return);
|
||||||
@@ -235,7 +245,7 @@ QMap<Utils::Id, QVariantMap> RunConfiguration::aspectData() const
|
|||||||
{
|
{
|
||||||
QMap<Utils::Id, QVariantMap> data;
|
QMap<Utils::Id, QVariantMap> data;
|
||||||
for (BaseAspect *aspect : qAsConst(m_aspects))
|
for (BaseAspect *aspect : qAsConst(m_aspects))
|
||||||
aspect->toMap(data[aspect->id()]);
|
aspect->toActiveMap(data[aspect->id()]);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -114,6 +114,7 @@ protected:
|
|||||||
friend class RunConfiguration;
|
friend class RunConfiguration;
|
||||||
void fromMap(const QVariantMap &map) override;
|
void fromMap(const QVariantMap &map) override;
|
||||||
void toMap(QVariantMap &data) const override;
|
void toMap(QVariantMap &data) const override;
|
||||||
|
void toActiveMap(QVariantMap &data) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_useGlobalSettings = false;
|
bool m_useGlobalSettings = false;
|
||||||
|
Reference in New Issue
Block a user