Allow user folder to be set via command line.

Clean up GetUserPath(), to allow setting any path with it.
This commit is contained in:
Rachel Bryk
2013-08-24 23:15:55 -04:00
parent 417bfb2630
commit 8882f89bbc
2 changed files with 76 additions and 9 deletions

View File

@ -128,6 +128,7 @@ bool DolphinApp::OnInit()
wxString videoBackendName;
wxString audioEmulationName;
wxString userPath;
#if wxUSE_CMDLINE_PARSER // Parse command lines
wxCmdLineEntryDesc cmdLineDesc[] =
@ -172,6 +173,11 @@ bool DolphinApp::OnInit()
"Play a movie file",
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
},
{
wxCMD_LINE_OPTION, "U", "user",
"User folder path",
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
},
{
wxCMD_LINE_NONE, NULL, NULL, NULL, wxCMD_LINE_VAL_NONE, 0
}
@ -193,6 +199,12 @@ bool DolphinApp::OnInit()
selectAudioEmulation = parser.Found(wxT("audio_emulation"),
&audioEmulationName);
playMovie = parser.Found(wxT("movie"), &movieFile);
if (parser.Found(wxT("user"), &userPath))
{
File::CreateFullPath(WxStrToStr(userPath) + DIR_SEP);
File::GetUserPath(D_USER_IDX, userPath.ToStdString() + DIR_SEP);
}
#endif // wxUSE_CMDLINE_PARSER
#if defined _DEBUG && defined _WIN32