assdraw: create the config dir if it doesn't already exist

Originally committed to SVN as r6869.
This commit is contained in:
Thomas Goyne 2012-05-24 01:56:39 +00:00
parent 03259b3ceb
commit 4b662d74f4

View file

@ -141,10 +141,13 @@ ASSDrawFrame::ASSDrawFrame( wxApp *app, const wxString& title, const wxPoint& po
InitializeDefaultSettings();
// load config
configfile = wxFileName(wxStandardPaths::Get().GetUserConfigDir(), _T("ASSDraw3.cfg")).GetFullPath();
configfile = wxFileName(wxStandardPaths::Get().GetUserDataDir(), _T("ASSDraw3.cfg")).GetFullPath();
bool firsttime = !::wxFileExists(configfile);
if (firsttime) wxFileOutputStream(configfile).Close();
if (firsttime) {
wxFileName::Mkdir(wxStandardPaths::Get().GetUserDataDir(), wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL);
wxFileOutputStream(configfile).Close();
}
wxFileInputStream cfgf(configfile);
config = new wxFileConfig(cfgf);