libsaria: Save to XDG_CONFIG_HOME
I plan on storing all my preferences there rather than creating my own save directory. This will keep things consistent with other applications the user may have.
This commit is contained in:
parent
1996b54065
commit
c8daf92af4
|
@ -53,14 +53,17 @@ void readdir(string dir, vector<file> &files, vector<file> &dirs)
|
|||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
static string SARIA_DIR = "/.saria-debug";
|
||||
static string SARIA_DIR = "/saria-debug";
|
||||
#else /* DEBUG */
|
||||
static string SARIA_DIR = "/.saria";
|
||||
static string SARIA_DIR = "/saria";
|
||||
#endif /* DEBUG */
|
||||
|
||||
string get_saria_dir()
|
||||
{
|
||||
string saria = getenv("HOME");
|
||||
string saria = ".config";
|
||||
char *xdg = getenv("XDG_CONFIG_HOME");
|
||||
if (xdg != NULL)
|
||||
saria = xdg;
|
||||
return saria += SARIA_DIR;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue