ProjectExplorer: Add a ProjectConfiguration::target()

... with a suitable default implementation accessing a member
populated at construction time instead of walking the parent
chains on each access.

Change-Id: I58dae6da80ed0b023cc603fca13a5a205b123672
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-07-26 16:08:13 +02:00
parent 8493a6b044
commit d16330de6d
16 changed files with 42 additions and 79 deletions

View File

@@ -160,6 +160,7 @@ static std::vector<RunConfiguration::AspectFactory> theAspectFactories;
RunConfiguration::RunConfiguration(Target *target, Core::Id id)
: ProjectConfiguration(target, id)
{
QTC_CHECK(target && target == this->target());
connect(target->project(), &Project::parsingStarted,
this, [this]() { updateEnabledState(); });
connect(target->project(), &Project::parsingFinished,
@@ -308,16 +309,6 @@ BuildConfiguration *RunConfiguration::activeBuildConfiguration() const
return target()->activeBuildConfiguration();
}
Target *RunConfiguration::target() const
{
return static_cast<Target *>(parent());
}
Project *RunConfiguration::project() const
{
return target()->project();
}
QVariantMap RunConfiguration::toMap() const
{
QVariantMap map = ProjectConfiguration::toMap();