Clang: Use timer in ClangIpcServer in the file watcher to send diagnostics

One mechanism for all diagnostic updates is better to maintain.

Change-Id: I774577bfa343162ded362977a0727a12379d1eab
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Marco Bubke
2015-08-26 16:47:38 +02:00
parent 0267f2861d
commit 283ddb8df3
6 changed files with 16 additions and 16 deletions

View File

@@ -59,14 +59,6 @@ ClangFileSystemWatcher::ClangFileSystemWatcher(TranslationUnits &translationUnit
&QFileSystemWatcher::fileChanged,
this,
&ClangFileSystemWatcher::updateTranslationUnitsWithChangedDependencies);
connect(&changedDiagnosticsTimer,
&QTimer::timeout,
this,
&ClangFileSystemWatcher::sendChangedDiagnostics);
changedDiagnosticsTimer.setSingleShot(true);
changedDiagnosticsTimer.setInterval(100);
}
void ClangFileSystemWatcher::addFiles(const QSet<Utf8String> &filePaths)
@@ -77,13 +69,9 @@ void ClangFileSystemWatcher::addFiles(const QSet<Utf8String> &filePaths)
void ClangFileSystemWatcher::updateTranslationUnitsWithChangedDependencies(const QString &filePath)
{
translationUnits.updateTranslationUnitsWithChangedDependencies(filePath);
changedDiagnosticsTimer.start();
watcher.addPath(filePath);
}
void ClangFileSystemWatcher::sendChangedDiagnostics()
{
translationUnits.sendChangedDiagnostics();
emit fileChanged();
}
} // namespace ClangBackEnd