ProjectExplorer: Handle parsingStarted/Finished in BuildConfiguration

Make all buildconfigurations disabled while the project parses.

This unifies how this is handled in different build systems.

Change-Id: I6afca3743ad1433529a4f9d3bfdf73042799e456
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Tobias Hunger
2019-08-14 12:26:59 +02:00
parent 183f01cc1d
commit 988d376ad0
12 changed files with 10 additions and 87 deletions

View File

@@ -106,6 +106,9 @@ BuildConfiguration::BuildConfiguration(Target *target, Core::Id id)
this->target()->buildEnvironmentChanged(this);
});
connect(project(), &Project::parsingStarted, this, &BuildConfiguration::enabledChanged);
connect(project(), &Project::parsingFinished, this, &BuildConfiguration::enabledChanged);
connect(this, &BuildConfiguration::enabledChanged, this, [this] {
if (isActive() && project() == SessionManager::startupProject()) {
ProjectExplorerPlugin::updateActions();
@@ -336,11 +339,15 @@ void BuildConfiguration::setUserEnvironmentChanges(const Utils::EnvironmentItems
bool BuildConfiguration::isEnabled() const
{
return true;
return !project()->isParsing() && project()->hasParsingData();
}
QString BuildConfiguration::disabledReason() const
{
if (project()->isParsing())
return (tr("The project is currently being parsed."));
if (!project()->hasParsingData())
return (tr("The project was not parsed successfully."));
return QString();
}