CMake: Return empty tree on errors in server-mode

This triggers the fallback mechanism which will make sure the CMakeLists.txt
file will be displayed.

This used to fail since one empty folder was left over in the project.

Task-number: QTCREATORBUG-17383
Change-Id: I867fd9039bc5df805ff5174ec49084bbcf688824
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Tobias Hunger
2016-12-02 17:32:31 +01:00
parent 7e10f84c2e
commit 45ad669a88
4 changed files with 33 additions and 20 deletions

View File

@@ -142,19 +142,25 @@ void CMakeBuildConfiguration::ctor()
displayName(), BuildConfiguration::Unknown));
connect(m_buildDirManager.get(), &BuildDirManager::dataAvailable,
this, &CMakeBuildConfiguration::dataAvailable);
this, [this, project]() {
project->updateProjectData(this);
emit dataAvailable();
});
connect(m_buildDirManager.get(), &BuildDirManager::errorOccured,
this, &CMakeBuildConfiguration::setError);
this, [this, project](const QString &msg) {
project->updateProjectData(this);
setError(msg);
});
connect(m_buildDirManager.get(), &BuildDirManager::configurationStarted,
this, &CMakeBuildConfiguration::parsingStarted);
this, [this, project]() {
project->handleParsingStarted();
emit parsingStarted();
});
connect(this, &CMakeBuildConfiguration::environmentChanged,
m_buildDirManager.get(), &BuildDirManager::forceReparse);
connect(this, &CMakeBuildConfiguration::buildDirectoryChanged,
m_buildDirManager.get(), &BuildDirManager::forceReparse);
connect(this, &CMakeBuildConfiguration::parsingStarted, project, &CMakeProject::handleParsingStarted);
connect(this, &CMakeBuildConfiguration::dataAvailable, project, &CMakeProject::updateProjectData);
}
void CMakeBuildConfiguration::maybeForceReparse()
@@ -378,10 +384,10 @@ CMakeConfig CMakeBuildConfiguration::cmakeConfiguration() const
void CMakeBuildConfiguration::setError(const QString &message)
{
if (m_error == message)
return;
m_error = message;
emit enabledChanged();
if (m_error != message) {
emit enabledChanged();
m_error = message;
}
emit errorOccured(m_error);
}