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/cppprojectupdater.h | |
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/cppprojectupdater.h')
-rw-r--r-- | src/plugins/cpptools/cppprojectupdater.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppprojectupdater.h b/src/plugins/cpptools/cppprojectupdater.h index 6b994871ef..c356ab63d1 100644 --- a/src/plugins/cpptools/cppprojectupdater.h +++ b/src/plugins/cpptools/cppprojectupdater.h @@ -29,6 +29,7 @@ #include "cpptools_global.h" #include "projectinfo.h" +#include <projectexplorer/extracompiler.h> #include <utils/futuresynchronizer.h> #include <QFutureWatcher> @@ -54,18 +55,26 @@ class CPPTOOLS_EXPORT CppProjectUpdater final : public QObject, public CppProjec public: CppProjectUpdater(); + ~CppProjectUpdater() override; void update(const ProjectExplorer::ProjectUpdateInfo &projectUpdateInfo) override; + void update(const ProjectExplorer::ProjectUpdateInfo &projectUpdateInfo, + const QList<ProjectExplorer::ExtraCompiler *> &extraCompilers); void cancel() override; private: void onToolChainRemoved(ProjectExplorer::ToolChain *); void onProjectInfoGenerated(); + void checkForExtraCompilersFinished(); private: ProjectExplorer::ProjectUpdateInfo m_projectUpdateInfo; + QList<QPointer<ProjectExplorer::ExtraCompiler>> m_extraCompilers; QFutureWatcher<ProjectInfo> m_generateFutureWatcher; + bool m_isProjectInfoGenerated = false; + QSet<QFutureWatcher<void> *> m_extraCompilersFutureWatchers; + std::unique_ptr<QFutureInterface<void>> m_projectUpdateFutureInterface; Utils::FutureSynchronizer m_futureSynchronizer; }; |