aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlformat/qmlformat.cpp
diff options
context:
space:
mode:
authorDmitrii Akshintsev <dmitrii.akshintsev@qt.io>2024-01-08 17:52:18 +0100
committerDmitrii Akshintsev <dmitrii.akshintsev@qt.io>2024-01-18 18:46:18 +0100
commit3805424abc7f61c3c3643d143d0cb8fdefbc5269 (patch)
tree72b51ec38563e367241c048b03a76789af5306a9 /tools/qmlformat/qmlformat.cpp
parent3fb693d7dad9070d7c574fc320b35e5ca6a5d2c7 (diff)
DOM refactoring. Move loadPendingDependencies to DomEnvironment
One of the goals of this refactoring is to move DomTop specific functionality from DomItem API to the corresponding DomEnvironment and DomUniverse. This commit moves loading of the dependencies (which are added to the pending load queue implicitly as part of the callbacks of the loadFile when DomEnv is created without the flag "NoDependencies") to the DomEnvironment interface Moreover, once work with dependencies is happening through the DomEnvironment explicitly, it allows us to get rid of "self" parameter. Task-number: QTBUG-119550 Change-Id: Ib3deb97eabe091ffded8c8c782ee08f8024468f2 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Diffstat (limited to 'tools/qmlformat/qmlformat.cpp')
-rw-r--r--tools/qmlformat/qmlformat.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/qmlformat/qmlformat.cpp b/tools/qmlformat/qmlformat.cpp
index 78bbcd5956..326387cd7e 100644
--- a/tools/qmlformat/qmlformat.cpp
+++ b/tools/qmlformat/qmlformat.cpp
@@ -53,7 +53,6 @@ bool parseFile(const QString &filename, const Options &options)
QQmlJS::Dom::DomEnvironment::Option::SingleThreaded
| QQmlJS::Dom::DomEnvironment::Option::NoDependencies);
DomItem tFile; // place where to store the loaded file
- DomItem env(envPtr);
envPtr->loadFile(
FileToLoad::fromFileSystem(envPtr, filename),
[&tFile](Path, const DomItem &, const DomItem &newIt) {
@@ -61,7 +60,7 @@ bool parseFile(const QString &filename, const Options &options)
// external file pair (path, oldValue, newValue)
},
LoadOption::DefaultLoad);
- env.loadPendingDependencies();
+ envPtr->loadPendingDependencies();
DomItem qmlFile = tFile.fileObject();
std::shared_ptr<QmlFile> qmlFilePtr = qmlFile.ownerAs<QmlFile>();
if (!qmlFilePtr || !qmlFilePtr->isValid()) {