forked from qt-creator/qt-creator
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user