mirror of https://github.com/stella-emu/stella.git
For UNIX-only, use version-specific config file if it already exists.
- I'm tired of switching between version 5.x and 6.x, and constantly having to reset sound settings :( - Backporting this to a local copy of 5.x, so both can co-exist, and going forward too - Not quite ready to advertise this functionality yet ...
This commit is contained in:
parent
56d9bdc163
commit
9890c648cb
|
@ -17,6 +17,8 @@
|
|||
|
||||
#include <cstdlib>
|
||||
|
||||
#include "FSNode.hxx"
|
||||
#include "Version.hxx"
|
||||
#include "OSystemUNIX.hxx"
|
||||
|
||||
/**
|
||||
|
@ -38,7 +40,17 @@ OSystemUNIX::OSystemUNIX()
|
|||
if(configDir == nullptr) configDir = "~/.config";
|
||||
|
||||
string stellaDir = string(configDir) + "/stella";
|
||||
|
||||
setBaseDir(stellaDir);
|
||||
setConfigFile(stellaDir + "/stellarc");
|
||||
|
||||
// (Currently) non-documented alternative for using version-specific
|
||||
// config file
|
||||
ostringstream buf;
|
||||
buf << stellaDir << "/stellarc" << "-" << STELLA_VERSION;
|
||||
|
||||
// Use version-specific config file only if it already exists
|
||||
FilesystemNode altConfigFile(buf.str());
|
||||
if(altConfigFile.exists() && altConfigFile.isWritable())
|
||||
setConfigFile(altConfigFile.getPath());
|
||||
else
|
||||
setConfigFile(stellaDir + "/stellarc");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue