forked from qt-creator/qt-creator
ProjectExplorer: Trigger full run config update when parsing finished
The update is meant to be cheap, and this makes it easier to reason about what state the ui is meant to be in after a parser finished. Also, make on in-object connection a normal function call. Saves cycles and bytes and also makes order of execution defined. Change-Id: I9a411cd2a1ed1e0cc677bf45a7a5ea367efd7d0b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -165,12 +165,7 @@ RunConfiguration::RunConfiguration(Target *target, Core::Id id)
|
||||
: ProjectConfiguration(target, id)
|
||||
{
|
||||
QTC_CHECK(target && target == this->target());
|
||||
connect(target, &Target::parsingFinished, this, &RunConfiguration::enabledChanged);
|
||||
|
||||
connect(this, &RunConfiguration::enabledChanged, this, [this] {
|
||||
if (isActive() && project() == SessionManager::startupProject())
|
||||
emit ProjectExplorerPlugin::instance()->updateRunActions();
|
||||
});
|
||||
connect(target, &Target::parsingFinished, this, &RunConfiguration::update);
|
||||
|
||||
Utils::MacroExpander *expander = macroExpander();
|
||||
expander->setDisplayName(tr("Run Settings"));
|
||||
@@ -309,6 +304,9 @@ void RunConfiguration::update()
|
||||
m_updater();
|
||||
|
||||
emit enabledChanged();
|
||||
|
||||
if (isActive() && project() == SessionManager::startupProject())
|
||||
emit ProjectExplorerPlugin::instance()->updateRunActions();
|
||||
}
|
||||
|
||||
BuildTargetInfo RunConfiguration::buildTargetInfo() const
|
||||
|
||||
Reference in New Issue
Block a user