diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-02-22 16:00:56 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-02-24 13:01:42 +0100 |
commit | 74bf3c8c333c30f4d3b4db31b5cc0b5150a08c88 (patch) | |
tree | 54bbffdbf74dc20cf8bdf22b34e46dc9c75c62b6 /tools/qmlcachegen/qmlcachegen.cpp | |
parent | c603d30887d6b56ec7e67f9adfcfe01ca3d9b523 (diff) |
Rework QQmlJSResourceFileMapper
We need more generic filtering capabilities so that it can, for example,
retrieve all the .qml files in a directory, both as qrc paths and local
file paths.
Change-Id: I72a72abc6dd39adb41bcd035f7aa6777e50cb5a5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'tools/qmlcachegen/qmlcachegen.cpp')
-rw-r--r-- | tools/qmlcachegen/qmlcachegen.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/qmlcachegen/qmlcachegen.cpp b/tools/qmlcachegen/qmlcachegen.cpp index a011442528..285e6c02ea 100644 --- a/tools/qmlcachegen/qmlcachegen.cpp +++ b/tools/qmlcachegen/qmlcachegen.cpp @@ -167,8 +167,9 @@ int main(int argc, char **argv) QQmlJSResourceFileMapper mapper(sources); QQmlJSCompileError error; - if (!qQmlJSGenerateLoader(mapper.qmlCompilerFiles(), outputFileName, - parser.values(resourceFileMappingOption), &error.message)) { + if (!qQmlJSGenerateLoader( + mapper.resourcePaths(QQmlJSResourceFileMapper::allQmlJSFilter()), + outputFileName, parser.values(resourceFileMappingOption), &error.message)) { error.augment(QLatin1String("Error generating loader stub: ")).print(); return EXIT_FAILURE; } @@ -194,7 +195,8 @@ int main(int argc, char **argv) // If the user didn't specify the resource path corresponding to the file on disk being // compiled, try to determine it from the resource file, if one was supplied. if (inputResourcePath.isEmpty()) { - const QStringList resourcePaths = fileMapper.resourcePaths(inputFile); + const QStringList resourcePaths = fileMapper.resourcePaths( + QQmlJSResourceFileMapper::localFileFilter(inputFile)); if (resourcePaths.isEmpty()) { fprintf(stderr, "No resource path for file: %s\n", qPrintable(inputFile)); return EXIT_FAILURE; |