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:
Bryan Schumaker 2011-10-02 10:52:23 -04:00
parent 1996b54065
commit c8daf92af4
1 changed files with 6 additions and 3 deletions

View File

@ -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;
}