13
0

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
This commit is contained in:
Robin Gareus 2024-09-22 16:12:13 +02:00
parent adf511264b
commit 66fdee2e45
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -315,7 +315,7 @@ UIConfiguration::color_file_name (bool use_my, bool with_version, bool fallback)
std::string rev (revision); std::string rev (revision);
std::size_t pos = rev.find_first_of("-"); std::size_t pos = rev.find_first_of("-");
if (with_version && pos != string::npos && pos > 0) { if (with_version && pos > 0) {
basename += "-"; basename += "-";
basename += rev.substr (0, pos); // COLORFILE_VERSION - program major.minor 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)) { if (find_file (sp, color_file_name (true, true), cfile)) {
found = true; 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 */ /* 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); root->add_child_nocopy (*parent);
XMLTree tree; 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); tree.set_root (root);