Merge remote-tracking branch 'origin/4.9'

Change-Id: If36258b8e572b5c7875433a31a836e4f06e27286
This commit is contained in:
Eike Ziller
2019-03-21 11:28:21 +01:00
47 changed files with 2860 additions and 1312 deletions

View File

@@ -408,14 +408,29 @@ CompilationDatabaseProject::CompilationDatabaseProject(const Utils::FileName &pr
m_kit.reset(KitManager::defaultKit()->clone());
connect(this, &CompilationDatabaseProject::parsingFinished,
this, [this]() { addTarget(createTarget(m_kit.get())); });
emitParsingStarted();
const QFuture<void> future = ::Utils::runAsync([this, projectFile](){
buildTreeAndProjectParts(projectFile);
connect(this, &CompilationDatabaseProject::parsingFinished, this, [this]() {
if (!m_hasTarget) {
addTarget(createTarget(m_kit.get()));
m_hasTarget = true;
}
});
reparseProject(projectFile);
m_fileSystemWatcher.addFile(projectFile.toString(), Utils::FileSystemWatcher::WatchModifiedDate);
connect(&m_fileSystemWatcher,
&Utils::FileSystemWatcher::fileChanged,
this,
[this](const QString &projectFile) {
reparseProject(Utils::FileName::fromString(projectFile));
});
}
void CompilationDatabaseProject::reparseProject(const Utils::FileName &projectFile)
{
emitParsingStarted();
const QFuture<void> future = ::Utils::runAsync(
[this, projectFile]() { buildTreeAndProjectParts(projectFile); });
m_parserWatcher.setFuture(future);
}