diff options
author | Oliver Wolff <oliver.wolff@qt.io> | 2018-01-03 14:08:22 +0100 |
---|---|---|
committer | Oliver Wolff <oliver.wolff@qt.io> | 2018-01-05 07:37:20 +0000 |
commit | 9f2ce7e2f651f30daf5403ad04ce2464b85480c8 (patch) | |
tree | 5f4b0ead3b4bd666770c4daa7e0842f6634bc3e5 /src/winmain | |
parent | 4a11243d3c37ab6917c8e99275259853d1970ec5 (diff) |
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>
Diffstat (limited to 'src/winmain')
-rw-r--r-- | src/winmain/qtmain_winrt.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/winmain/qtmain_winrt.cpp b/src/winmain/qtmain_winrt.cpp index 13ca561d35..1a3ad33322 100644 --- a/src/winmain/qtmain_winrt.cpp +++ b/src/winmain/qtmain_winrt.cpp @@ -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 |