forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user