bindings: move some code from .h to .cpp file
This commit is contained in:
@@ -592,3 +592,27 @@ void BindingsConfiguration::generateDefaults()
|
||||
if (notBound(k = stringToKey("-")))
|
||||
bind(k, Actions::Type::VolumeDown);
|
||||
}
|
||||
|
||||
const Command *BindingsConfiguration::findCommand(const std::string &name)
|
||||
{
|
||||
const Command *ptr = nullptr;
|
||||
auto it = m_commands.find(name);
|
||||
if (it != m_commands.end())
|
||||
ptr = &it->second;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
BindingsConfiguration::BindingIteratorPair BindingsConfiguration::get(const Key &k)
|
||||
{
|
||||
std::pair<BindingIterator, BindingIterator> result;
|
||||
auto it = m_bindings.find(k);
|
||||
if (it != m_bindings.end()) {
|
||||
result.first = it->second.begin();
|
||||
result.second = it->second.end();
|
||||
} else {
|
||||
auto list_end = m_bindings.begin()->second.end();
|
||||
result.first = list_end;
|
||||
result.second = list_end;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user