winrt: Remove -qdevel and -qdebug from command line parameters

These options are used by winrtrunner/Qt Creator to control logging
and debugging behavior and should not influence applications.
Without this change applications that use
QCommandLineParser::process have to explicitly remove these values
from the arguments list or the application will exit with an
"unknown option" error when run from Qt Creator.

As winrt applications do not natively support command line arguments,
breaking the use case of having these values as valid command line
options is acceptable.

[ChangeLog][qtmain][winrt] -qdevel and -qdebug are removed from the
command line arguments and not passed to the application.

Change-Id: I60e5565148fd3dd0155b946607fdf5042139d2e1
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
This commit is contained in:
Oliver Wolff 2018-01-03 14:08:22 +01:00
parent 4a11243d3c
commit 9f2ce7e2f6

View File

@ -295,11 +295,15 @@ private:
bool develMode = false;
bool debugWait = false;
for (const char *arg : args) {
if (strcmp(arg, "-qdevel") == 0)
for (int i = args.count() - 1; i >= 0; --i) {
const char *arg = args.at(i);
if (strcmp(arg, "-qdevel") == 0) {
develMode = true;
if (strcmp(arg, "-qdebug") == 0)
args.remove(i);
} else if (strcmp(arg, "-qdebug") == 0) {
debugWait = true;
args.remove(i);
}
}
if (develMode) {
// Write a PID file to help runner