From 66fdee2e457ffe5d5d18440b95397394822edf3c Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 22 Sep 2024 16:12:13 +0200 Subject: [PATCH] Require user's color theme files to be versioned Previously tagged releases did not append major.minor version to a user's "my-*.colors" file. Ardour also loaded theme files which a user saved with a previous version. When new colors were added, those are missing from the older my-*.colors file. see also https://discourse.ardour.org/t/color-theme-issues-with-ardour-8-7/110729/20 --- gtk2_ardour/ui_config.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/gtk2_ardour/ui_config.cc b/gtk2_ardour/ui_config.cc index 428707e78f..0dbc8b9d04 100644 --- a/gtk2_ardour/ui_config.cc +++ b/gtk2_ardour/ui_config.cc @@ -315,7 +315,7 @@ UIConfiguration::color_file_name (bool use_my, bool with_version, bool fallback) std::string rev (revision); std::size_t pos = rev.find_first_of("-"); - if (with_version && pos != string::npos && pos > 0) { + if (with_version && pos > 0) { basename += "-"; basename += rev.substr (0, pos); // COLORFILE_VERSION - program major.minor } @@ -364,12 +364,6 @@ UIConfiguration::load_color_theme (bool allow_own) if (find_file (sp, color_file_name (true, true), cfile)) { found = true; } - - if (!found) { - if (find_file (sp, color_file_name (true, false), cfile)) { - found = true; - } - } } /* now search for a versioned color file (for this major.minor version) CURRENTLY UNUSED */ @@ -439,7 +433,7 @@ UIConfiguration::store_color_theme () root->add_child_nocopy (*parent); XMLTree tree; - std::string colorfile = Glib::build_filename (user_config_directory(), color_file_name (true, true));; + std::string colorfile = Glib::build_filename (user_config_directory(), color_file_name (true, true)); tree.set_root (root);