diff options
| author | Shawn Hoffman <godisgovernment@gmail.com> | 2023-04-19 09:40:12 -0700 |
|---|---|---|
| committer | Shawn Hoffman <godisgovernment@gmail.com> | 2023-04-25 10:50:49 -0700 |
| commit | b00e898affc7dd81baecacbd421a0855964b3f75 (patch) | |
| tree | 706c099ee2860439e21f93a3bc8442bd70143f5d /Source | |
| parent | b20cc6b67e30373597edd761102dca4b8f31d391 (diff) | |
DolphinQt: fix handling of Qt-specific cmdline args
QApplication should parse and remove and args it recognizes
before dolphin starts inspecting the args.
This allows using e.g. -style <style> on the commandline.
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/DolphinQt/Main.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/Source/Core/DolphinQt/Main.cpp b/Source/Core/DolphinQt/Main.cpp index 37415224dd..8e1e63d030 100644 --- a/Source/Core/DolphinQt/Main.cpp +++ b/Source/Core/DolphinQt/Main.cpp @@ -147,19 +147,16 @@ int main(int argc, char* argv[]) #endif #endif - auto parser = CommandLineParse::CreateParser(CommandLineParse::ParserOptions::IncludeGUIOptions); - const optparse::Values& options = CommandLineParse::ParseArguments(parser.get(), argc, argv); - const std::vector<std::string> args = parser->args(); - QCoreApplication::setOrganizationName(QStringLiteral("Dolphin Emulator")); QCoreApplication::setOrganizationDomain(QStringLiteral("dolphin-emu.org")); QCoreApplication::setApplicationName(QStringLiteral("dolphin-emu")); -#ifdef _WIN32 - QApplication app(__argc, __argv); -#else + // QApplication will parse arguments and remove any it recognizes as targeting Qt QApplication app(argc, argv); -#endif + + auto parser = CommandLineParse::CreateParser(CommandLineParse::ParserOptions::IncludeGUIOptions); + const optparse::Values& options = CommandLineParse::ParseArguments(parser.get(), argc, argv); + const std::vector<std::string> args = parser->args(); #ifdef _WIN32 FreeConsole(); |
