forked from qt-creator/qt-creator
Clang: Add timer based path notification compression
QFileWatcher is only reporting one path per signal which is suboptimal if you change many files at once. This patch is introducing a timer which is waiting some time time to see if more path changes are reported and is collecting them in a vector. Change-Id: I50f7c21186353b199634e7b3cd5a41f8d581a31d Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
#include <QFileSystemWatcher>
|
||||
#include <QLoggingCategory>
|
||||
#include <QTemporaryDir>
|
||||
#include <QTimer>
|
||||
|
||||
using ClangBackEnd::ClangPathWatcher;
|
||||
using ClangBackEnd::ConnectionServer;
|
||||
@@ -93,11 +94,15 @@ int main(int argc, char *argv[])
|
||||
const QString connection = processArguments(application);
|
||||
|
||||
StringCache<Utils::SmallString> filePathCache;
|
||||
ClangPathWatcher<QFileSystemWatcher> includeWatcher(filePathCache);
|
||||
ClangPathWatcher<QFileSystemWatcher, QTimer> includeWatcher(filePathCache);
|
||||
ApplicationEnvironment environment;
|
||||
PchCreator pchCreator(environment, filePathCache);
|
||||
ProjectParts projectParts;
|
||||
PchManagerServer clangPchManagerServer(filePathCache, includeWatcher, pchCreator, projectParts);
|
||||
PchManagerServer clangPchManagerServer(filePathCache,
|
||||
includeWatcher,
|
||||
pchCreator,
|
||||
projectParts);
|
||||
includeWatcher.setNotifier(&clangPchManagerServer);
|
||||
ConnectionServer<PchManagerServer, PchManagerClientProxy> connectionServer(connection);
|
||||
connectionServer.start();
|
||||
connectionServer.setServer(&clangPchManagerServer);
|
||||
|
||||
Reference in New Issue
Block a user