qtdeclarative/tools
Sami Shalayel 6913084b0d Remove DomItem::loadFile code-duplication and use correct environments
The loadFile overload (in DomItem, DomEnvironment and DomUnivers) for
different files (in-memory files and files that needs to be loaded from
disk) are either copypasted or just calling the other overload.

Encapsulate the file-related arguments of all loadFile overloads into a
new struct called FileToLoad, such that the copypasted overloads can be
removed. Use the static factory function FileToLoad::fromMemory and
FileToLoad::fromFileSystem to create the FileToLoad struct.

In addition, FileToLoad allows to specify the environment in which a
file should be loaded. Prior this commit, myEnv.loadFile() was creating
a new environment for each loaded file.

Change-Id: I3b6acb681cb77faefdaa447d985bdfbe4f6a9ce2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-03-29 19:07:25 +02:00
..
qml qml tool: Fix incorrect mapping of --transparent to MSAA 2023-03-17 12:12:52 +01:00
qmlcachegen QML: Turn singleton/type mismatch into a run time type error 2023-01-27 10:42:06 +01:00
qmldom Remove DomItem::loadFile code-duplication and use correct environments 2023-03-29 19:07:25 +02:00
qmleasing Remove Qt keywords from all headers 2022-12-09 11:55:10 +08:00
qmlformat Remove DomItem::loadFile code-duplication and use correct environments 2023-03-29 19:07:25 +02:00
qmlimportscanner Port from container::count() and length() to size() - V5 2022-10-13 00:18:35 +02:00
qmljs Port from qAsConst() to std::as_const() 2022-10-07 23:38:56 +02:00
qmljsrootgen Port to new Q_UNREACHABLE_RETURN() 2022-10-20 23:59:33 +02:00
qmllint qmlls: move into own private static library 2023-02-07 19:23:13 +01:00
qmlls qmlls: move into own private static library 2023-02-07 19:23:13 +01:00
qmlplugindump qmlplugindump: Don't crash on value types with extensions 2023-01-04 08:55:55 +01:00
qmlpreview Remove Qt keywords from all headers 2022-12-09 11:55:10 +08:00
qmlprofiler Remove Qt keywords from all headers 2022-12-09 11:55:10 +08:00
qmlscene Port to new Q_UNREACHABLE_RETURN() 2022-10-20 23:59:33 +02:00
qmltc Doc: Rename and rephrase pages for QML {script|type} compiler 2023-03-28 20:54:27 +02:00
qmltestrunner Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-09-07 17:01:30 +02:00
qmltime Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-09-07 17:01:30 +02:00
qmltyperegistrar qmltyperegistrar: Guard against file system failures 2023-02-17 11:06:21 +01:00
CMakeLists.txt Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-09-07 17:01:30 +02:00