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:
parent
ef38236034
commit
f0f97d0fbb
@ -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))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user