Avoid expanding QRC nodes in main thread

For CMake and Qbs projects and users of TreeScanner, where the tree is
already created in a separate thread.

Expanding the QRC nodes means reading and parsing the QRC files, which
can take up a considerable time (second(s)) if there are hundreds of
them in a larger project like Qt Creator.

Task-number: QTCREATORBUG-25783
Change-Id: I5ca818b9f75ea6e8ef23f837cc9e15df7e6630e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Eike Ziller
2021-06-21 16:14:20 +02:00
parent 9109a6895e
commit 0bcab32657
4 changed files with 13 additions and 0 deletions

View File

@@ -33,6 +33,8 @@
#include <utils/qtcprocess.h>
#include <utils/utilsicons.h>
#include <projectexplorer/projecttree.h>
#include <QDir>
using namespace ProjectExplorer;
@@ -708,6 +710,7 @@ FileApiQtcData extractData(FileApiData &input,
result.projectParts = generateRawProjectParts(data, sourceDirectory);
auto pair = generateRootProjectNode(data, sourceDirectory, buildDirectory);
ProjectTree::applyTreeManager(pair.first.get()); // QRC nodes
result.rootProjectNode = std::move(pair.first);
result.knownHeaders = std::move(pair.second);