13
0

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...
This commit is contained in:
Robin Gareus 2017-02-17 00:59:48 +01:00
parent d0e3eb42a6
commit 3864f2c32c

View File

@ -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)) {