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:
@@ -44,6 +44,7 @@ DeployConfiguration::DeployConfiguration(Target *target, Core::Id id)
|
||||
: ProjectConfiguration(target, id),
|
||||
m_stepList(this, Constants::BUILDSTEPS_DEPLOY)
|
||||
{
|
||||
QTC_CHECK(target && target == this->target());
|
||||
Utils::MacroExpander *expander = macroExpander();
|
||||
expander->setDisplayName(tr("Deploy Settings"));
|
||||
expander->setAccumulating(true);
|
||||
@@ -108,16 +109,6 @@ bool DeployConfiguration::fromMap(const QVariantMap &map)
|
||||
return true;
|
||||
}
|
||||
|
||||
Target *DeployConfiguration::target() const
|
||||
{
|
||||
return static_cast<Target *>(parent());
|
||||
}
|
||||
|
||||
Project *DeployConfiguration::project() const
|
||||
{
|
||||
return target()->project();
|
||||
}
|
||||
|
||||
bool DeployConfiguration::isActive() const
|
||||
{
|
||||
return target()->isActive() && target()->activeDeployConfiguration() == this;
|
||||
|
||||
Reference in New Issue
Block a user