From a9630727fe6b9c0180a937743c62b7c47a0aed54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Wed, 14 Jun 2017 14:31:30 +0200 Subject: [PATCH] Qt: Support custom user profile paths Pretty much the most important option to support, even for a UI frontend that's still a WIP. It's essential for testing. --- Source/Core/DolphinQt2/Main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinQt2/Main.cpp b/Source/Core/DolphinQt2/Main.cpp index 439c8b81c3..06fc993aaf 100644 --- a/Source/Core/DolphinQt2/Main.cpp +++ b/Source/Core/DolphinQt2/Main.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include #include #include #include @@ -15,6 +16,7 @@ #include "DolphinQt2/MainWindow.h" #include "DolphinQt2/Resources.h" #include "DolphinQt2/Settings.h" +#include "UICommon/CommandLineParse.h" #include "UICommon/UICommon.h" int main(int argc, char* argv[]) @@ -24,7 +26,11 @@ int main(int argc, char* argv[]) QApplication app(argc, argv); - UICommon::SetUserDirectory(""); + auto parser = CommandLineParse::CreateParser(CommandLineParse::ParserOptions::IncludeGUIOptions); + const optparse::Values& options = CommandLineParse::ParseArguments(parser.get(), argc, argv); + const std::vector args = parser->args(); + + UICommon::SetUserDirectory(static_cast(options.get("user"))); UICommon::CreateDirectories(); UICommon::Init(); Resources::Init();