Added support for SUPERTUXKART_SAVEDIR environment variable to

specify/overwrite where the user-specific files are written to.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7262 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2011-01-05 03:58:43 +00:00
parent ef38236034
commit f0f97d0fbb

View File

@ -408,6 +408,13 @@ bool FileManager::checkAndCreateDirectoryP(const std::string &path)
//-----------------------------------------------------------------------------
/** Checks if the config directory exists, and it not, tries to create it. */
void FileManager::checkAndCreateConfigDir()
{
if(getenv("SUPERTUXKART_SAVEDIR") &&
checkAndCreateDirectory(getenv("SUPERTUXKART_SAVEDIR")) )
{
m_config_dir = getenv("SUPERTUXKART_SAVEDIR");
}
else
{
#if defined(WIN32)
// Try to use the APPDATA directory to store config files and highscore
@ -475,6 +482,8 @@ void FileManager::checkAndCreateConfigDir()
m_config_dir += "/";
m_config_dir += CONFIGDIR;
#endif
} // if(getenv("SUPERTUXKART_SAVEDIR") && checkAndCreateDirectory(...))
if(!checkAndCreateDirectory(m_config_dir))
{