Updated Linux/UNIX port to use XDG_CONFIG_HOME for storing settings

file.  For most people, that means the files are now stored in
'~/.config/stella' instead of '~/.stella'.  Manually moving the directory
will be necessary if you wish to keep the old settings.
This commit is contained in:
Stephen Anthony 2017-01-28 19:14:11 -03:30
parent 94e77d3b94
commit d99f83580f
3 changed files with 54 additions and 34 deletions

View File

@ -14,6 +14,17 @@
4.7.3 to 5.0: (xxx. xx, 2017) 4.7.3 to 5.0: (xxx. xx, 2017)
* For the Linux/UNIX port:
- The settings directory now uses the XDG Base Directory Specification.
In most cases, this means that your files will now be stored in
'~/.config/stella' instead of '~/.stella'. To keep your old settings,
run the following commands from the terminal:
cd ~
mv .stella .config/stella
You will probably need to edit '~/.config/stella/stellarc' and change
some paths accordingly.
* For the OSX port: * For the OSX port:
- Always use the built-in zlib library instead of the system version. - Always use the built-in zlib library instead of the system version.
@ -23,6 +34,7 @@
cd ~/Library/Preferences cd ~/Library/Preferences
mv net.sourceforge.Stella.plist Stella-emu.plist mv net.sourceforge.Stella.plist Stella-emu.plist
* Updated included PNG and ZLIB libraries to latest stable version.
-Have fun! -Have fun!

View File

@ -2963,7 +2963,7 @@
<p><table cellpadding="5" border="1"> <p><table cellpadding="5" border="1">
<tr> <tr>
<td><b>Linux/Unix</b></td> <td><b>Linux/Unix</b></td>
<td><i>$HOME/.stella/stellarc</i></td> <td><i>$HOME/.config/stella/stellarc</i></td>
</tr> </tr>
<tr> <tr>
<td><b>Macintosh</b></td> <td><b>Macintosh</b></td>
@ -3062,7 +3062,7 @@ Ms Pac-Man (Stella extended codes):
<p><table cellpadding="5" border="1"> <p><table cellpadding="5" border="1">
<tr> <tr>
<td><b>Linux/Unix</b></td> <td><b>Linux/Unix</b></td>
<td><i>$HOME/.stella/stella.cht</i></td> <td><i>$HOME/.config/stella/stella.cht</i></td>
</tr> </tr>
<tr> <tr>
<td><b>Macintosh</b></td> <td><b>Macintosh</b></td>
@ -3396,7 +3396,7 @@ Ms Pac-Man (Stella extended codes):
<p><table cellpadding="5" border="1"> <p><table cellpadding="5" border="1">
<tr> <tr>
<td><b>Linux/Unix</b></td> <td><b>Linux/Unix</b></td>
<td><i>$HOME/.stella/stella.pro</i></td> <td><i>$HOME/.config/stella/stella.pro</i></td>
</tr> </tr>
<tr> <tr>
<td><b>Macintosh</b></td> <td><b>Macintosh</b></td>
@ -3461,7 +3461,7 @@ Ms Pac-Man (Stella extended codes):
<p><table cellpadding="5" border="1"> <p><table cellpadding="5" border="1">
<tr> <tr>
<td><b>Linux/Unix</b></td> <td><b>Linux/Unix</b></td>
<td><i>$HOME/.stella/stella.pal</i></td> <td><i>$HOME/.config/stella/stella.pal</i></td>
</tr> </tr>
<tr> <tr>
<td><b>Macintosh</b></td> <td><b>Macintosh</b></td>

View File

@ -15,6 +15,8 @@
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
//============================================================================ //============================================================================
#include <cstdlib>
#include "OSystemUNIX.hxx" #include "OSystemUNIX.hxx"
/** /**
@ -31,6 +33,12 @@
OSystemUNIX::OSystemUNIX() OSystemUNIX::OSystemUNIX()
: OSystem() : OSystem()
{ {
setBaseDir("~/.stella"); // Use XDG_CONFIG_HOME if defined, otherwise use the default
setConfigFile("~/.stella/stellarc"); const char* configDir = getenv("XDG_CONFIG_HOME");
if(configDir == NULL) configDir = "~/.config";
string stellaDir = string(configDir) + "/stella";
setBaseDir(stellaDir);
setConfigFile(stellaDir + "/stellarc");
} }