summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2023-05-03 07:13:53 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-02-08 02:06:50 +0000
commita5c3ee2000e7a3f18e08738105e2e99eed7e5026 (patch)
treeaf4b24d07bbe17bc9b1c41e47e5acc85ecb1cfaf
parent844c71653c49d4bd15fae1f886ff010070062f8a (diff)
Minor. Add warning about webEngineArgs and QTWEBENGINE_CHROMIUM_FLAGS
In case of exported QTWEBENGINE_CHROMIUM_FLAGS webEngineArgs are overridden, this is not an issue till user forgets about an export and wonders why things do not work as expected. Note some of our tests use webEngineArgs and setting QTWEBENGINE_CHROMIUM_FLAGS will simply end in some failed test cases. Save some trouble and warn about potential issue. Change-Id: Ifd8cf76403179f5844eb11ad0dc60f6300a6af4e Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io> (cherry picked from commit 03376cb2ca15d51aba075fb088a13543595c139a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/core/web_engine_context.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index ece36c315..e7e952a0c 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -921,12 +921,14 @@ base::CommandLine *WebEngineContext::initCommandLine(bool &useEmbeddedSwitches,
}
base::CommandLine *parsedCommandLine = base::CommandLine::ForCurrentProcess();
+ int index = appArgs.indexOf(QRegularExpression(QLatin1String("--webEngineArgs"),
+ QRegularExpression::CaseInsensitiveOption));
if (qEnvironmentVariableIsSet(kChromiumFlagsEnv)) {
appArgs = appArgs.mid(0, 1); // Take application name and drop the rest
appArgs.append(parseEnvCommandLine(qEnvironmentVariable(kChromiumFlagsEnv)));
+ if (index > -1)
+ qWarning("Note 'webEngineArgs' are overridden by QTWEBENGINE_CHROMIUM_FLAGS");
} else {
- int index = appArgs.indexOf(QRegularExpression(QLatin1String("--webEngineArgs"),
- QRegularExpression::CaseInsensitiveOption));
if (index > -1) {
appArgs.erase(appArgs.begin() + 1, appArgs.begin() + index + 1);
} else {