From 7f453cab9eb70ebe30f526130e0f883f3ec724ed Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 27 Sep 2023 01:04:47 +0200 Subject: [PATCH] Allow to query cache-dir by major version Luckily "cachename" parameter was unused, so this API can be changed. --- libs/ardour/ardour/filesystem_paths.h | 2 +- libs/ardour/filesystem_paths.cc | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/libs/ardour/ardour/filesystem_paths.h b/libs/ardour/ardour/filesystem_paths.h index 028c93c002..2a2079fbb8 100644 --- a/libs/ardour/ardour/filesystem_paths.h +++ b/libs/ardour/ardour/filesystem_paths.h @@ -45,7 +45,7 @@ namespace ARDOUR { * caches (e.g. plugin indices, blacklist/whitelist) * it defaults to XDG_CACHE_HOME */ - LIBARDOUR_API std::string user_cache_directory (std::string cachename = ""); + LIBARDOUR_API std::string user_cache_directory (int version = -1); /** * @return the path used to store a persistent indication diff --git a/libs/ardour/filesystem_paths.cc b/libs/ardour/filesystem_paths.cc index df6005c662..ebe3511840 100644 --- a/libs/ardour/filesystem_paths.cc +++ b/libs/ardour/filesystem_paths.cc @@ -129,7 +129,7 @@ user_config_directory (int version) } std::string -user_cache_directory (std::string cachename) +user_cache_directory (int version) { std::string p; @@ -164,11 +164,7 @@ user_cache_directory (std::string cachename) } #endif // end not __APPLE__ - if (cachename.empty ()) { - p = Glib::build_filename (p, user_config_directory_name ()); - } else { - p = Glib::build_filename (p, cachename); - } + p = Glib::build_filename (p, user_config_directory_name (version)); #ifdef PLATFORM_WINDOWS /* On Windows Glib::get_user_data_dir is the folder to use for local