forked from qt-creator/qt-creator
ProjectExplorer: Make ProjectConfiguration an AspectContainer
... instead of having one. AspectContainer are de-factor (q)objects with "fat" properties, conceptionally not much different from QObject itself, so there's not real need to differentiate between the QObject interface and the (forwarded) aspectcontainer interface. As a side-effect, this saves one QObject base object per instance. Change-Id: I6eefe739b3aebcef1ece196ff8d70aa36738997b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -217,7 +217,7 @@ bool RunConfiguration::isEnabled() const
|
||||
QWidget *RunConfiguration::createConfigurationWidget()
|
||||
{
|
||||
Layouting::Form form;
|
||||
for (BaseAspect *aspect : std::as_const(m_aspects)) {
|
||||
for (BaseAspect *aspect : std::as_const(*this)) {
|
||||
if (aspect->isVisible()) {
|
||||
form.addItem(aspect);
|
||||
form.addItem(Layouting::br);
|
||||
@@ -247,7 +247,7 @@ void RunConfiguration::addAspectFactory(const AspectFactory &aspectFactory)
|
||||
QMap<Utils::Id, QVariantMap> RunConfiguration::settingsData() const
|
||||
{
|
||||
QMap<Utils::Id, QVariantMap> data;
|
||||
for (BaseAspect *aspect : m_aspects)
|
||||
for (BaseAspect *aspect : *this)
|
||||
aspect->toActiveMap(data[aspect->id()]);
|
||||
return data;
|
||||
}
|
||||
@@ -255,7 +255,7 @@ QMap<Utils::Id, QVariantMap> RunConfiguration::settingsData() const
|
||||
AspectContainerData RunConfiguration::aspectData() const
|
||||
{
|
||||
AspectContainerData data;
|
||||
for (BaseAspect *aspect : m_aspects)
|
||||
for (BaseAspect *aspect : *this)
|
||||
data.append(aspect->extractData());
|
||||
return data;
|
||||
}
|
||||
@@ -566,7 +566,7 @@ RunConfiguration *RunConfigurationFactory::create(Target *target) const
|
||||
|
||||
// Add the universal aspects.
|
||||
for (const RunConfiguration::AspectFactory &factory : theAspectFactories)
|
||||
rc->m_aspects.registerAspect(factory(target));
|
||||
rc->registerAspect(factory(target));
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user