fs/StandardDirectory: add GetUserCacheDir()
Move code from CreateConfiguredDatabase() and add XDG support. This implements an automatic Linux fallback for the setting "db_file" if none was specified.
This commit is contained in:
@@ -50,6 +50,8 @@
|
||||
#ifdef ANDROID
|
||||
#include "java/Global.hxx"
|
||||
#include "android/Environment.hxx"
|
||||
#include "android/Context.hxx"
|
||||
#include "Main.hxx"
|
||||
#endif
|
||||
|
||||
#ifndef WIN32
|
||||
@@ -252,6 +254,18 @@ AllocatedPath GetUserMusicDir()
|
||||
#endif
|
||||
}
|
||||
|
||||
AllocatedPath
|
||||
GetUserCacheDir()
|
||||
{
|
||||
#ifdef USE_XDG
|
||||
return GetUserDir("XDG_CACHE_DIR");
|
||||
#elif defined(ANDROID)
|
||||
return context->GetCacheDir(Java::GetEnv());
|
||||
#else
|
||||
return AllocatedPath::Null();
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
AllocatedPath GetSystemConfigDir()
|
||||
|
Reference in New Issue
Block a user