summaryrefslogtreecommitdiff
path: root/src/playlist_editor.cpp
diff options
context:
space:
mode:
authorAndrzej Rybczak <electricityispower@gmail.com>2013-04-28 23:25:08 +0200
committerAndrzej Rybczak <electricityispower@gmail.com>2013-04-28 23:25:08 +0200
commit786ffe9182d1ab3346875248e58feca3223a649e (patch)
tree49f764d957e1c8e9105dd6bb4da9af3dfd266739 /src/playlist_editor.cpp
parentd0b0f1f57c8c61f91b55adb8afe82e423a806bf3 (diff)
clear filters when empty string is passed to applyFilter
boost::regex doesn't like empty strings in literal mode and throws exceptions.
Diffstat (limited to 'src/playlist_editor.cpp')
-rw-r--r--src/playlist_editor.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/playlist_editor.cpp b/src/playlist_editor.cpp
index 66ed4cf4..1ce14db2 100644
--- a/src/playlist_editor.cpp
+++ b/src/playlist_editor.cpp
@@ -335,6 +335,20 @@ std::string PlaylistEditor::currentFilter()
void PlaylistEditor::applyFilter(const std::string &filter)
{
+ if (filter.empty())
+ {
+ if (isActiveWindow(Playlists))
+ {
+ Playlists.clearFilter();
+ Playlists.clearFilterResults();
+ }
+ else if (isActiveWindow(Content))
+ {
+ Content.clearFilter();
+ Content.clearFilterResults();
+ }
+ return;
+ }
try
{
if (isActiveWindow(Playlists))