diff options
author | Robin Gareus <robin@gareus.org> | 2017-02-17 00:59:48 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-02-17 00:59:48 +0100 |
commit | 3864f2c32c89436baff76beda1ad1bd6a3944d9a (patch) | |
tree | 9c2d0f25aeb63ac0bf863c17bbf9816095a8aae0 /gtk2_ardour/keyboard.cc | |
parent | d0e3eb42a62343ca91d5efef40003c0035039e7d (diff) |
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...
Diffstat (limited to 'gtk2_ardour/keyboard.cc')
-rw-r--r-- | gtk2_ardour/keyboard.cc | 11 |
1 files changed, 11 insertions, 0 deletions
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)) { |