From 50a095bedef5e9648f1e8e1f406cd6117a455880 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Mon, 26 Feb 2018 14:25:25 +0100 Subject: [PATCH] qtmain_winrt: Remove unused leftovers from Windows (Phone) 8.1 times On Windows (Phone) 8.1 __getmainargs was still supported and used to do the initialization of the application's parameters and environment. When that functionality was removed together with the now unsupported OSs,the initial filling of argc, argv, and env part was forgotten. Change-Id: I3b788de317b22b4525427faefc3fe974dac5d9ac Reviewed-by: Maurice Kalinowski --- src/winmain/qtmain_winrt.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/winmain/qtmain_winrt.cpp b/src/winmain/qtmain_winrt.cpp index 21aed27c7ff..b072248603e 100644 --- a/src/winmain/qtmain_winrt.cpp +++ b/src/winmain/qtmain_winrt.cpp @@ -149,12 +149,8 @@ public: { } - int exec(int argc, char **argv) + int exec() { - args.reserve(argc); - for (int i = 0; i < argc; ++i) - args.append(argv[i]); - mainThread = CreateThread(NULL, 0, [](void *param) -> DWORD { AppContainer *app = reinterpret_cast(param); int argc = app->args.count() - 1; @@ -381,18 +377,9 @@ private: // Main entry point for Appx containers int __stdcall WinMain(HINSTANCE, HINSTANCE, LPSTR, int) { - int argc = 0; - char **argv = 0, **env = 0; - for (int i = 0; env && env[i]; ++i) { - QByteArray var(env[i]); - int split = var.indexOf('='); - if (split > 0) - qputenv(var.mid(0, split), var.mid(split + 1)); - } - if (FAILED(RoInitialize(RO_INIT_MULTITHREADED))) return 1; ComPtr app = Make(); - return app->exec(argc, argv); + return app->exec(); }