Fixed bug in Windows, where 'Documents\Stella' wasn't being created.

This commit is contained in:
Stephen Anthony 2017-09-09 15:40:07 -02:30
parent b7bf3b79b2
commit b814296a9e
1 changed files with 8 additions and 3 deletions

View File

@ -71,7 +71,7 @@ OSystemWINDOWS::OSystemWINDOWS()
basedir = appdata.getShortPath();
if(basedir.length() > 1 && basedir[basedir.length()-1] != '\\')
basedir += '\\';
basedir += "Stella";
basedir += "Stella\\";
}
else
basedir = ".\\"; // otherwise, default to current directory
@ -79,14 +79,19 @@ OSystemWINDOWS::OSystemWINDOWS()
setBaseDir(basedir);
setConfigFile(basedir + "stella.ini");
// Create default save/load dir
FilesystemNode node(defaultSaveDir());
if(!node.exists())
node.makeDir();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string OSystemWINDOWS::defaultSaveDir() const
{
HomeFinder homefinder;
FilesystemNode desktop(homefinder.getDesktopPath() + "\\Stella");
return desktop.isDirectory() ? desktop.getShortPath() : "~\\";
FilesystemNode documents(homefinder.getDocumentsPath());
return documents.isDirectory() ? documents.getShortPath() + "\\Stella\\" : "~\\";
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -