diff options
| author | Sami Shalayel <sami.shalayel@qt.io> | 2023-03-10 12:07:27 +0100 |
|---|---|---|
| committer | Sami Shalayel <sami.shalayel@qt.io> | 2023-03-29 19:07:25 +0200 |
| commit | 6913084b0d649b78dc10b80cd9b8d77d51a50c8b (patch) | |
| tree | 9eb887e161ed877e61b26ad9f15d83753712fc5f /examples/qml/referenceexamples/referenceexamples.qmlproject | |
| parent | 7ad7eb606a0831568dc55c782d1a7cdc8fb395b3 (diff) | |
| download | qtdeclarative-6913084b0d649b78dc10b80cd9b8d77d51a50c8b.tar.gz | |
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>
Diffstat (limited to 'examples/qml/referenceexamples/referenceexamples.qmlproject')
0 files changed, 0 insertions, 0 deletions
