diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2020-02-04 12:27:58 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2020-02-06 15:53:46 +0000 |
commit | cd9571b4f76798f2f40966d13c86bf204c040e68 (patch) | |
tree | 4e12f30d8c0956fe7ad323978f9809f9fed0bd2d /src/plugins/cpptools/cppprojectupdater.cpp | |
parent | fd8187cb8687af35d8cf58d97a4d83a30da39e8c (diff) | |
download | qt-creator-cd9571b4f76798f2f40966d13c86bf204c040e68.tar.gz |
CppTools: Optionally move raw project parts creation into thread
... by letting callers pass in a generator function.
This takes some load off the UI thread for larger projects.
For now only used by the QbsProjectManager, which can provide a thread-
safe generator function due to the project data existing in "value"
form.
Task-number: QTCREATORBUG-18533
Change-Id: I525dea36a4c4079bd1bd5a4fff844617547d56f1
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/cpptools/cppprojectupdater.cpp')
-rw-r--r-- | src/plugins/cpptools/cppprojectupdater.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/cpptools/cppprojectupdater.cpp b/src/plugins/cpptools/cppprojectupdater.cpp index f89f8e9fc8..4d95c5800e 100644 --- a/src/plugins/cpptools/cppprojectupdater.cpp +++ b/src/plugins/cpptools/cppprojectupdater.cpp @@ -61,7 +61,10 @@ void CppProjectUpdater::update(const ProjectExplorer::ProjectUpdateInfo &project // Run the project info generator in a worker thread and continue if that one is finished. const QFuture<ProjectInfo> future = Utils::runAsync([=]() { - Internal::ProjectInfoGenerator generator(m_futureInterface, projectUpdateInfo); + ProjectUpdateInfo fullProjectUpdateInfo = projectUpdateInfo; + if (fullProjectUpdateInfo.rppGenerator) + fullProjectUpdateInfo.rawProjectParts = fullProjectUpdateInfo.rppGenerator(); + Internal::ProjectInfoGenerator generator(m_futureInterface, fullProjectUpdateInfo); return generator.generate(); }); m_generateFutureWatcher.setFuture(future); |