+ data_model->set_sort_column (owner.sort_column, owner.sort_type);
+ filter->refilter ();
+}
+
+bool
+KeyEditor::Tab::visible_func(const Gtk::TreeModel::const_iterator& iter) const
+{
+ if (!iter) {
+ return false;
+ }
+
+ // never filter when search string is empty or item is a category
+ if (owner.filter_string.empty () || !(*iter)[columns.bindable]) {
+ return true;
+ }
+
+ // search name
+ std::string name = (*iter)[columns.name];
+ boost::to_lower (name);
+ if (name.find (owner.filter_string) != std::string::npos) {
+ return true;
+ }
+
+ // search binding
+ std::string binding = (*iter)[columns.binding];
+ boost::to_lower (binding);
+ if (binding.find (owner.filter_string) != std::string::npos) {
+ return true;
+ }
+
+ return false;
+}
+
+TreeModel::iterator
+KeyEditor::Tab::find_action_path (TreeModel::const_iterator begin, TreeModel::const_iterator end, const std::string& action_path) const
+{
+ if (!begin) {
+ return end;
+ }
+
+ for (TreeModel::iterator it = begin; it != end; ++it) {
+ if (it->children()) {
+ TreeModel::iterator jt = find_action_path (it->children().begin(), it->children().end(), action_path);
+ if (jt != it->children().end()) {
+ return jt;
+ }
+ }
+ const std::string& path = (*it)[columns.path];
+ if (action_path.compare(path) == 0) {
+ return it;
+ }
+ }
+ return end;