Skip to content

Commit

Permalink
Merge pull request #5609 from leoetlino/qt-user-path
Browse files Browse the repository at this point in the history
Qt: Support custom user profile paths
  • Loading branch information
Helios747 committed Jun 14, 2017
2 parents 40a9e58 + a963072 commit 335f54c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Source/Core/DolphinQt2/Main.cpp
Expand Up @@ -2,6 +2,7 @@
// Licensed under GPLv2+
// Refer to the license.txt file included.

#include <OptionParser.h>
#include <QAbstractEventDispatcher>
#include <QApplication>
#include <QMessageBox>
Expand All @@ -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[])
Expand All @@ -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<std::string> args = parser->args();

UICommon::SetUserDirectory(static_cast<const char*>(options.get("user")));
UICommon::CreateDirectories();
UICommon::Init();
Resources::Init();
Expand Down

0 comments on commit 335f54c

Please sign in to comment.