allow to get custom/product/version independent cach dir
This commit is contained in:
parent
0fc4a61fa0
commit
cf8cc19449
@ -43,7 +43,7 @@ namespace ARDOUR {
|
||||
* caches (e.g. plugin indices, blacklist/whitelist)
|
||||
* it defaults to XDG_CACHE_HOME
|
||||
*/
|
||||
LIBARDOUR_API std::string user_cache_directory ();
|
||||
LIBARDOUR_API std::string user_cache_directory (std::string cachename = "");
|
||||
|
||||
/**
|
||||
* @return the path used to store a persistent indication
|
||||
|
@ -132,11 +132,9 @@ user_config_directory (int version)
|
||||
}
|
||||
|
||||
std::string
|
||||
user_cache_directory ()
|
||||
user_cache_directory (std::string cachename)
|
||||
{
|
||||
static std::string p;
|
||||
|
||||
if (!p.empty()) return p;
|
||||
std::string p;
|
||||
|
||||
#ifdef __APPLE__
|
||||
p = Glib::build_filename (Glib::get_home_dir(), "Library/Caches");
|
||||
@ -169,7 +167,11 @@ user_cache_directory ()
|
||||
}
|
||||
#endif // end not __APPLE__
|
||||
|
||||
p = Glib::build_filename (p, user_config_directory_name ());
|
||||
if (cachename.empty ()) {
|
||||
p = Glib::build_filename (p, user_config_directory_name ());
|
||||
} else {
|
||||
p = Glib::build_filename (p, cachename);
|
||||
}
|
||||
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
/* On Windows Glib::get_user_data_dir is the folder to use for local
|
||||
|
Loading…
Reference in New Issue
Block a user