mirror of https://github.com/snes9xgit/snes9x.git
Gtk: Fix config directory order.
Search for XDG_CONFIG_HOME. If that exists, use $XDG_CONFIG_HOME/snes9x, otherwise use $HOME/.config/snes9x. Remove broken legacy check.
This commit is contained in:
parent
a9e64edf73
commit
ed3695f704
|
@ -33,22 +33,18 @@ std::string get_config_dir()
|
|||
return std::string{".snes9x"};
|
||||
}
|
||||
|
||||
fs::path config = env_home;
|
||||
fs::path legacy = config;
|
||||
|
||||
fs::path config;
|
||||
// If XDG_CONFIG_HOME is set, use that, otherwise guess default
|
||||
if (!env_xdg_config_home)
|
||||
{
|
||||
config /= ".config/snes9x";
|
||||
legacy /= ".snes9x";
|
||||
}
|
||||
else
|
||||
if (env_xdg_config_home)
|
||||
{
|
||||
config = env_xdg_config_home;
|
||||
config /= "snes9x";
|
||||
}
|
||||
if (fs::exists(legacy) && !fs::exists(config))
|
||||
return legacy;
|
||||
else
|
||||
{
|
||||
config = env_home;
|
||||
config /= ".config/snes9x";
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue