Commit 7a388e7b authored by Tobias Hunger's avatar Tobias Hunger
Browse files

CMake: Improve emission of enabledChanged signals of build configurations



Change-Id: I542b93512466727ac4ee66a8ca41e503106ebdcb
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: default avatarhjk <hjk@qt.io>
parent 758e50fa
......@@ -145,7 +145,7 @@ void CMakeBuildConfiguration::ctor()
connect(m_buildDirManager.get(), &BuildDirManager::dataAvailable,
this, [this, project]() {
project->updateProjectData(this);
emit enabledChanged();
clearError();
emit dataAvailable();
});
connect(m_buildDirManager.get(), &BuildDirManager::errorOccured,
......@@ -153,7 +153,7 @@ void CMakeBuildConfiguration::ctor()
connect(m_buildDirManager.get(), &BuildDirManager::configurationStarted,
this, [this, project]() {
project->handleParsingStarted();
emit enabledChanged();
clearError(ForceEnabledChanged::True);
emit parsingStarted();
});
......@@ -176,6 +176,7 @@ bool CMakeBuildConfiguration::isParsing() const
void CMakeBuildConfiguration::resetData()
{
clearError();
m_buildDirManager->resetData();
}
......@@ -342,12 +343,14 @@ void CMakeBuildConfiguration::setCurrentCMakeConfiguration(const QList<ConfigMod
m_buildDirManager->forceReparse();
}
void CMakeBuildConfiguration::clearError()
void CMakeBuildConfiguration::clearError(ForceEnabledChanged fec)
{
if (!m_error.isEmpty()) {
m_error.clear();
emit enabledChanged();
fec = ForceEnabledChanged::True;
}
if (fec == ForceEnabledChanged::True)
emit enabledChanged();
}
void CMakeBuildConfiguration::emitBuildTypeChanged()
......
......@@ -109,10 +109,12 @@ protected:
private:
void ctor();
enum ForceEnabledChanged : quint8 { False, True };
void clearError(ForceEnabledChanged fec = ForceEnabledChanged::False);
QList<ConfigModel::DataItem> completeCMakeConfiguration() const;
void setCurrentCMakeConfiguration(const QList<ConfigModel::DataItem> &items);
void clearError();
void setError(const QString &message);
void setWarning(const QString &message);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment