From 3864f2c32c89436baff76beda1ad1bd6a3944d9a Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 17 Feb 2017 00:59:48 +0100 Subject: Version keybindings file. Allow to run both Ardour 5.5 and later (changed bindings name) with the same config folder. Like with .color files, custom .keys files won't be taken into account when updating to a new version. This is mostly a stopgap solution. Eventually we'll have to come up with a merge&prune mechanism for bindings or maintain a separate version for these files. Hopefully some better idea will come up... --- gtk2_ardour/keyboard.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'gtk2_ardour/keyboard.cc') diff --git a/gtk2_ardour/keyboard.cc b/gtk2_ardour/keyboard.cc index 2e24f56abb..d5b9dd8c45 100644 --- a/gtk2_ardour/keyboard.cc +++ b/gtk2_ardour/keyboard.cc @@ -23,6 +23,7 @@ #include "pbd/basename.h" #include "ardour/filesystem_paths.h" +#include "ardour/revision.h" #include "ardour_ui.h" #include "public_editor.h" @@ -103,6 +104,16 @@ ArdourKeyboard::setup_keybindings () string lowercase_program_name = downcase (string(PROGRAM_NAME)); +#ifndef MIXBUS // not for v4.0 just yet + /* extract and append minor vesion */ + std::string rev (revision); + std::size_t pos = rev.find_first_of("-"); + if (pos != string::npos && pos > 0) { + lowercase_program_name += "-"; + lowercase_program_name += rev.substr (0, pos); + } +#endif + user_keybindings_path = Glib::build_filename (user_config_directory(), lowercase_program_name + binding_filename_suffix); if (Glib::file_test (user_keybindings_path, Glib::FILE_TEST_EXISTS)) { -- cgit v1.2.3