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:
hjk
2020-01-20 14:42:34 +01:00
parent 57e3a03538
commit d32f1cd2ea
2 changed files with 5 additions and 7 deletions

View File

@@ -35,7 +35,7 @@ class GenericBuildConfiguration : public ProjectExplorer::BuildConfiguration
Q_OBJECT Q_OBJECT
friend class ProjectExplorer::BuildConfigurationFactory; friend class ProjectExplorer::BuildConfigurationFactory;
GenericBuildConfiguration(ProjectExplorer::Target *parent, Core::Id id); GenericBuildConfiguration(ProjectExplorer::Target *target, Core::Id id);
void addToEnvironment(Utils::Environment &env) const final; void addToEnvironment(Utils::Environment &env) const final;
}; };

View File

@@ -165,12 +165,7 @@ RunConfiguration::RunConfiguration(Target *target, Core::Id id)
: ProjectConfiguration(target, id) : ProjectConfiguration(target, id)
{ {
QTC_CHECK(target && target == this->target()); QTC_CHECK(target && target == this->target());
connect(target, &Target::parsingFinished, this, &RunConfiguration::enabledChanged); connect(target, &Target::parsingFinished, this, &RunConfiguration::update);
connect(this, &RunConfiguration::enabledChanged, this, [this] {
if (isActive() && project() == SessionManager::startupProject())
emit ProjectExplorerPlugin::instance()->updateRunActions();
});
Utils::MacroExpander *expander = macroExpander(); Utils::MacroExpander *expander = macroExpander();
expander->setDisplayName(tr("Run Settings")); expander->setDisplayName(tr("Run Settings"));
@@ -309,6 +304,9 @@ void RunConfiguration::update()
m_updater(); m_updater();
emit enabledChanged(); emit enabledChanged();
if (isActive() && project() == SessionManager::startupProject())
emit ProjectExplorerPlugin::instance()->updateRunActions();
} }
BuildTargetInfo RunConfiguration::buildTargetInfo() const BuildTargetInfo RunConfiguration::buildTargetInfo() const