From 65a1e717005d009e295786d1e7faf22fa2da8abe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Keller?= Date: Tue, 27 Feb 2024 10:57:41 +0100 Subject: [PATCH] Windeployqt: fix exclusion option for Internal modules The "Internal" suffix was added to module names, but only in the help text and not in the option's name. Change this by adding the "Internal" suffix to the option name in general, rather than just the help text. Fixes: QTBUG-122774 Pick-to: 6.7 Change-Id: Iaffcde4768a8bf70ba4b8e52cec4ea6490e20bfc Reviewed-by: Oliver Wolff (cherry picked from commit 7c218d20aedd8aaf2c0f2b6954ac400902ae040b) Reviewed-by: Qt Cherry-pick Bot --- src/tools/windeployqt/main.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tools/windeployqt/main.cpp b/src/tools/windeployqt/main.cpp index 0115fb6023a..2eabc35e245 100644 --- a/src/tools/windeployqt/main.cpp +++ b/src/tools/windeployqt/main.cpp @@ -88,13 +88,15 @@ static inline QString webProcessBinary(const char *binaryName, Platform p) return (p & WindowsBased) ? webProcess + QStringLiteral(".exe") : webProcess; } -static QString moduleNameToOptionName(const QString &moduleName) +static QString moduleNameToOptionName(const QString &moduleName, bool internal) { QString result = moduleName .mid(3) // strip the "Qt6" prefix .toLower(); if (result == u"help"_s) result.prepend("qt"_L1); + if (internal) + result.append("Internal"_L1); return result; } @@ -106,10 +108,8 @@ static QByteArray formatQtModules(const ModuleBitset &mask, bool option = false) if (!result.isEmpty()) result.append(' '); result.append(option - ? moduleNameToOptionName(qtModule.name).toUtf8() + ? moduleNameToOptionName(qtModule.name, qtModule.internal).toUtf8() : qtModule.name.toUtf8()); - if (qtModule.internal) - result.append("Internal"); } } return result; @@ -527,7 +527,7 @@ static inline int parseArguments(const QStringList &arguments, QCommandLineParse enabledModuleOptions.reserve(qtModulesCount); disabledModuleOptions.reserve(qtModulesCount); for (const QtModule &module : qtModuleEntries) { - const QString option = moduleNameToOptionName(module.name); + const QString option = moduleNameToOptionName(module.name, module.internal); const QString name = module.name; if (name == u"InsightTracker") { parser->addOption(deployInsightTrackerOption); @@ -769,7 +769,7 @@ static inline QString helpText(const QCommandLineParser &p, const PluginInformat if (qtModuleEntries.size() == 0) return result; const QtModule &firstModule = qtModuleEntries.moduleById(0); - const QString firstModuleOption = moduleNameToOptionName(firstModule.name); + const QString firstModuleOption = moduleNameToOptionName(firstModule.name, firstModule.internal); const qsizetype moduleStart = result.indexOf("\n --"_L1 + firstModuleOption); const qsizetype argumentsStart = result.lastIndexOf("\nArguments:"_L1); if (moduleStart >= argumentsStart)