Revert "Config dirs is now XDG compliant."

This reverts commit 9a76cb8839.
pull/40/head
Nestal Wan 2012-06-11 23:32:57 +08:00
parent 9a76cb8839
commit cf2c827a6e
1 changed files with 3 additions and 23 deletions

View File

@ -27,30 +27,10 @@ namespace gr {
const std::string& Config::Filename()
{
static std::string cfg_path;
char *cfg_base;
bool fallback;
fallback = false;
cfg_base = getenv("XDG_CONFIG_HOME");
if (!cfg_base)
{
fallback = true;
cfg_base = getenv("HOME");
/* Clutter the current directory if forced to */
if (!cfg_base)
cfg_base = (char *)".";
}
static const char *env_cfg = ::getenv( "GR_CONFIG" ) ;
static const std::string filename = (env_cfg != 0) ? env_cfg : ".grive" ;
cfg_path = cfg_base;
cfg_path += "/";
if (fallback) /* Hidden folder */
cfg_path += ".";
cfg_path += "grive";
cfg_path += "/";
cfg_path += "config.json";
return cfg_path ;
return filename ;
}
Config::Config() :