summaryrefslogtreecommitdiff
path: root/src/plugins/projectexplorer/runconfiguration.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2022-04-08 11:35:54 +0200
committerhjk <hjk@qt.io>2022-04-12 08:43:09 +0000
commit530b9ae85a19913c2421f26c738676b0c951d99f (patch)
tree097fa51fe12f2e663ad82ab7bcdcd9ee07f40b04 /src/plugins/projectexplorer/runconfiguration.cpp
parent24b4a7be74543226345d34797cd740a7a5b2969a (diff)
downloadqt-creator-530b9ae85a19913c2421f26c738676b0c951d99f.tar.gz
ProjectExplorer: Copy more RunConfiguration data to RunControl
The aspects are now responsible for defining what data needs to be copied and also to provide a suitable interface (kind of source-compatible to direct use) for access. The important change here is that RunControl::aspect(...) doesn't need to access RunControl::runConfiguration() in fully aspectified RunConfigurations anymore. In not-fully aspectified the runConfig access is moved to the user code to make the problem visible there. Long term, aspectification should be finished. As an additional benefit, the resolving of macros etc can now be done at the correct time. Change-Id: I690d9f8f696ce9b4efd42082ba3f81b514efcb77 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/runconfiguration.cpp')
-rw-r--r--src/plugins/projectexplorer/runconfiguration.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp
index 430eadb8da..01c68a9620 100644
--- a/src/plugins/projectexplorer/runconfiguration.cpp
+++ b/src/plugins/projectexplorer/runconfiguration.cpp
@@ -93,7 +93,10 @@ void ISettingsAspect::setConfigWidgetCreator(const ConfigWidgetCreator &configWi
//
///////////////////////////////////////////////////////////////////////
-GlobalOrProjectAspect::GlobalOrProjectAspect() = default;
+GlobalOrProjectAspect::GlobalOrProjectAspect()
+{
+ addDataExtractor(this, &GlobalOrProjectAspect::currentSettings, &Data::currentSettings);
+}
GlobalOrProjectAspect::~GlobalOrProjectAspect()
{
@@ -264,14 +267,20 @@ void RunConfiguration::addAspectFactory(const AspectFactory &aspectFactory)
theAspectFactories.push_back(aspectFactory);
}
-QMap<Utils::Id, QVariantMap> RunConfiguration::aspectData() const
+QMap<Utils::Id, QVariantMap> RunConfiguration::settingsData() const
{
QMap<Utils::Id, QVariantMap> data;
- for (BaseAspect *aspect : qAsConst(m_aspects))
+ for (BaseAspect *aspect : m_aspects)
aspect->toActiveMap(data[aspect->id()]);
return data;
}
+void RunConfiguration::storeAspectData(AspectContainerData *storage) const
+{
+ for (BaseAspect *aspect : m_aspects)
+ storage->append(aspect->extractData(&m_expander));
+}
+
BuildSystem *RunConfiguration::activeBuildSystem() const
{
return target()->buildSystem();