forked from qt-creator/qt-creator
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user