mirror of
https://github.com/snes9xgit/snes9x.git
synced 2025-04-02 10:42:16 -04:00
Compare commits
2 commits
a9e64edf73
...
d514d135a7
Author | SHA1 | Date | |
---|---|---|---|
|
d514d135a7 | ||
|
ed3695f704 |
1 changed files with 10 additions and 11 deletions
|
@ -33,22 +33,21 @@ std::string get_config_dir()
|
||||||
return std::string{".snes9x"};
|
return std::string{".snes9x"};
|
||||||
}
|
}
|
||||||
|
|
||||||
fs::path config = env_home;
|
fs::path config;
|
||||||
fs::path legacy = config;
|
|
||||||
|
|
||||||
// If XDG_CONFIG_HOME is set, use that, otherwise guess default
|
// If XDG_CONFIG_HOME is set, use that, otherwise guess default
|
||||||
if (!env_xdg_config_home)
|
if (env_xdg_config_home)
|
||||||
{
|
|
||||||
config /= ".config/snes9x";
|
|
||||||
legacy /= ".snes9x";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
config = env_xdg_config_home;
|
config = env_xdg_config_home;
|
||||||
config /= "snes9x";
|
config /= "snes9x";
|
||||||
}
|
}
|
||||||
if (fs::exists(legacy) && !fs::exists(config))
|
else
|
||||||
return legacy;
|
{
|
||||||
|
config = env_home;
|
||||||
|
config /= ".config/snes9x";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!fs::exists(config))
|
||||||
|
fs::create_directories(config);
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue