From 80095610292035a92a752fa14d3486f6a0877d43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Keller?= Date: Fri, 24 Mar 2023 15:27:40 +0100 Subject: 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 --- src/tools/windeployqt/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/tools/windeployqt') 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(), -- cgit v1.2.3