From 9f2ce7e2f651f30daf5403ad04ce2464b85480c8 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 3 Jan 2018 14:08:22 +0100 Subject: 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 Reviewed-by: Maurice Kalinowski --- src/winmain/qtmain_winrt.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/winmain/qtmain_winrt.cpp') 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 -- cgit v1.2.3