summaryrefslogtreecommitdiffstats
path: root/src/tools/windeployqt/qmlutils.cpp
diff options
context:
space:
mode:
authorArno Rehn <a.rehn@menlosystems.com>2023-09-25 13:11:58 +0200
committerArno Rehn <a.rehn@menlosystems.com>2023-10-10 13:19:34 +0200
commita1e052a2918b6863dada64cba1a67c16762cde85 (patch)
tree51354942e0a46656fd8ba5567c2428216a86f894 /src/tools/windeployqt/qmlutils.cpp
parent3ee57b83870567d52acc00e534ef022a6d3b150e (diff)
windeployqt: Don't copy files from unneeded QML modules
Previously, windeployqt would recurse into subdirectories when copying QML modules, even if those subdirectories were a nested QML module that was not needed for deployment. Since most QML modules are nested in the QtQuick and QtQml modules, the old code effectively always copied *all* QML modules. This patch adds guards that prevent recursing into subdirectories if those subdirectories represent QML modules. These nested modules will still be deployed, but only if referenced from the QML application (as determined by qmlimportscanner). Fixes: QTBUG-117459 Pick-to: 6.6 Change-Id: I4c0dfc15956ff40a0e8caec3fa334df10cc92ccd Reviewed-by: Timothée Keller <timothee.keller@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/tools/windeployqt/qmlutils.cpp')
-rw-r--r--src/tools/windeployqt/qmlutils.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tools/windeployqt/qmlutils.cpp b/src/tools/windeployqt/qmlutils.cpp
index 5104af01949..a7e63e74705 100644
--- a/src/tools/windeployqt/qmlutils.cpp
+++ b/src/tools/windeployqt/qmlutils.cpp
@@ -67,7 +67,8 @@ static void findFileRecursion(const QDir &directory, Platform platform,
const QFileInfoList &subDirs = directory.entryInfoList(QStringList(), QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks);
for (const QFileInfo &subDirFi : subDirs) {
QDir subDirectory(subDirFi.absoluteFilePath());
- if (subDirectory.isReadable())
+ // Don't enter other QML modules when recursing!
+ if (subDirectory.isReadable() && !subDirectory.exists(QStringLiteral("qmldir")))
findFileRecursion(subDirectory, platform, debugMatchMode, matches);
}
}