Implement fs::get_cache_dir

Win32: equal to config dir for now
Linux: respect XDG_CACHE_HOME if specified
OSX: possibly incomplete
This commit is contained in:
Nekotekina 2018-12-24 18:47:46 +03:00
parent 20efed66e9
commit bd9131ae1c
15 changed files with 69 additions and 28 deletions

View file

@ -276,7 +276,7 @@ void Emulator::Init()
{
if (!g_tty)
{
g_tty.open(fs::get_config_dir() + "TTY.log", fs::rewrite + fs::append);
g_tty.open(fs::get_cache_dir() + "TTY.log", fs::rewrite + fs::append);
}
idm::init();
@ -318,7 +318,7 @@ void Emulator::Init()
fs::create_dir(dev_hdd1 + "game/");
}
fs::create_path(fs::get_config_dir() + "shaderlog/");
fs::create_path(fs::get_cache_dir() + "shaderlog/");
fs::create_path(fs::get_config_dir() + "captures/");
#ifdef WITH_GDB_DEBUGGER
@ -771,7 +771,7 @@ void Emulator::Load(bool add_only)
// Initialize data/cache directory
if (fs::is_dir(m_path))
{
m_cache_path = fs::get_config_dir() + "data/" + GetTitleID() + '/';
m_cache_path = fs::get_cache_dir() + "data/" + GetTitleID() + '/';
LOG_NOTICE(LOADER, "Cache: %s", GetCachePath());
}
else