remove filtering

This commit is contained in:
Andrzej Rybczak
2014-11-05 00:19:44 +01:00
parent 413fe866de
commit 309a4989c9
26 changed files with 317 additions and 1040 deletions

View File

@@ -176,7 +176,6 @@ void SearchEngine::enterPressed()
}
else if (option == SearchButton)
{
w.showAll();
Statusbar::print("Searching...");
if (w.size() > StaticOptions)
Prepare();
@@ -256,37 +255,6 @@ void SearchEngine::mouseButtonPressed(MEVENT me)
/***********************************************************************/
bool SearchEngine::allowsFiltering()
{
return w.rbegin()->value().isSong();
}
std::string SearchEngine::currentFilter()
{
return RegexItemFilter<SEItem>::currentFilter(w);
}
void SearchEngine::applyFilter(const std::string &filter)
{
if (filter.empty())
{
w.clearFilter();
w.clearFilterResults();
return;
}
try
{
w.showAll();
auto fun = boost::bind(SEItemEntryMatcher, _1, _2, true);
auto rx = RegexItemFilter<SEItem>(
boost::regex(filter, Config.regex_type), fun);
w.filter(w.begin(), w.end(), rx);
}
catch (boost::bad_expression &) { }
}
/***********************************************************************/
bool SearchEngine::allowsSearching()
{
return w.rbegin()->value().isSong();