summaryrefslogtreecommitdiffstats
path: root/src/tools/windeployqt/main.cpp
diff options
context:
space:
mode:
authorTimothée Keller <timothee.keller@qt.io>2023-03-24 15:27:40 +0100
committerTimothée Keller <timothee.keller@qt.io>2023-04-06 12:18:34 +0200
commit80095610292035a92a752fa14d3486f6a0877d43 (patch)
tree7dad873f8771f320b23c705c7dc278ab47c25923 /src/tools/windeployqt/main.cpp
parenta81fa2047ba06a9adc5b3d507d844f200fe73800 (diff)
Windeployqt: Prevent '.' and '..' from being added to lconvert
If windeployqt is not able to retrieve any translation information from the catalog, the translationNameFilters will be empty. This allows the '.' and '..' folders to be passed to lconvert which in turn causes an error for the whole deployment. Added a check for the filters being empty, and a warning in case we have to preemptively return from the translation deployment. Fixes: QTBUG-112204 Pick-to: 6.5 Change-Id: I0d114186e630cc3696250006fa093c4c596eb40d Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/tools/windeployqt/main.cpp')
-rw-r--r--src/tools/windeployqt/main.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tools/windeployqt/main.cpp b/src/tools/windeployqt/main.cpp
index 6e3df22b75..68f7601789 100644
--- a/src/tools/windeployqt/main.cpp
+++ b/src/tools/windeployqt/main.cpp
@@ -995,7 +995,12 @@ static bool deployTranslations(const QString &sourcePath, const ModuleBitset &us
if (options.json)
options.json->addFile(sourcePath + u'/' + targetFile, absoluteTarget);
arguments.append(QDir::toNativeSeparators(targetFilePath));
- const QFileInfoList &langQmFiles = sourceDir.entryInfoList(translationNameFilters(usedQtModules, prefix));
+ const QStringList translationFilters = translationNameFilters(usedQtModules, prefix);
+ if (translationFilters.isEmpty()){
+ std::wcerr << "Warning: translation catalogs are all empty, skipping translation deployment\n";
+ return true;
+ }
+ const QFileInfoList &langQmFiles = sourceDir.entryInfoList(translationFilters);
for (const QFileInfo &langQmFileFi : langQmFiles) {
if (options.json) {
options.json->addFile(langQmFileFi.absoluteFilePath(),