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.
This commit is contained in:
Shawn Hoffman 2023-04-19 09:40:12 -07:00
parent b20cc6b67e
commit b00e898aff

View File

@ -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();