diff options
author | Eike Ziller <eike.ziller@qt.io> | 2021-06-29 15:26:23 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2021-07-05 08:16:25 +0000 |
commit | e3b639047f6a4a9c042987062bafdbf1726267cb (patch) | |
tree | 90ae3e473f0de6ea9aa6bcbf64e1f8475c001dc1 /src/plugins/cpptools/cppmodelmanager.cpp | |
parent | 68846a7729fb7fa67214ffa6484d2b2e08caf6f8 (diff) | |
download | qt-creator-e3b639047f6a4a9c042987062bafdbf1726267cb.tar.gz |
Don't update extra compilers individually after project load
Each call of CppModelManager::updateSourceFiles detaches the current
snapshot.
The extra compilers where set up and triggered individually, and
resulted in individual updateSourceFiles calls with the single result
file of the extra compiler. For Qt Creator this would lead to 200
calls in quick succession after project load, potentially leading to a
freeze of multiple seconds.
Instead of updating the result files of the extra compilers individually
after project load, integrate the update into the regular project source
file update. So we end up with only a single call of updateSourceFiles.
For this the project updater needs to trigger the extra compilers, and
wait for all to finish as well as the regular project part update,
before
triggering the parser.
Task-number: QTCREATORBUG-25783
Change-Id: I34f6df0fc0f96bcb42ee65019bee39cf49176c1f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/cpptools/cppmodelmanager.cpp')
-rw-r--r-- | src/plugins/cpptools/cppmodelmanager.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index f92248b222..2366b5d4da 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -1145,7 +1145,8 @@ void CppModelManager::updateCppEditorDocuments(bool projectsUpdated) const } } -QFuture<void> CppModelManager::updateProjectInfo(const ProjectInfo &newProjectInfo) +QFuture<void> CppModelManager::updateProjectInfo(const ProjectInfo &newProjectInfo, + const QSet<QString> &additionalFiles) { if (!newProjectInfo.isValid()) return QFuture<void>(); @@ -1236,6 +1237,7 @@ QFuture<void> CppModelManager::updateProjectInfo(const ProjectInfo &newProjectIn // resolved includes that we could rely on. updateCppEditorDocuments(/*projectsUpdated = */ true); + filesToReindex.unite(additionalFiles); // Trigger reindexing const QFuture<void> indexingFuture = updateSourceFiles(filesToReindex, ForcedProgressNotification); |