bindings: Support a bindings file in $XDG_CONFIG_HOME/ncmpcpp

Fixes https://github.com/arybczak/ncmpcpp/issues/91

This also rewrites the intro in doc/bindings to be more like doc/config.
This commit is contained in:
Wieland Hoffmann
2016-11-01 20:31:36 +01:00
committed by Andrzej Rybczak
parent 67df6b556b
commit e107edd4cd
4 changed files with 39 additions and 25 deletions

View File

@@ -467,6 +467,17 @@ bool BindingsConfiguration::read(const std::string &file)
return result;
}
bool BindingsConfiguration::read(const std::vector<std::string> &binding_paths)
{
return std::all_of(
binding_paths.begin(),
binding_paths.end(),
[&](const std::string &binding_path) {
return read(binding_path);
}
);
}
void BindingsConfiguration::generateDefaults()
{
NC::Key::Type k = NC::Key::None;