diff options
author | Andrzej Rybczak <electricityispower@gmail.com> | 2016-11-11 20:26:42 +0100 |
---|---|---|
committer | Andrzej Rybczak <electricityispower@gmail.com> | 2016-11-11 20:26:42 +0100 |
commit | 60e66b47b6748c48f9ee36e9ef80bc4b5d1a09e1 (patch) | |
tree | 5d4204e0c3db4731002cfbe6d7eaaa60da4b1db0 /src/playlist.cpp | |
parent | cbba364685b25d436e620bebcd37b024149d4171 (diff) |
searchable: retrieve currently applied search constraint
Diffstat (limited to 'src/playlist.cpp')
-rw-r--r-- | src/playlist.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/playlist.cpp b/src/playlist.cpp index 9dd9bcc3..b8994182 100644 --- a/src/playlist.cpp +++ b/src/playlist.cpp @@ -153,21 +153,27 @@ bool Playlist::allowsSearching() return true; } +const std::string &Playlist::searchConstraint() +{ + return m_search_predicate.constraint(); +} + void Playlist::setSearchConstraint(const std::string &constraint) { m_search_predicate = Regex::Filter<MPD::Song>( - Regex::make(constraint, Config.regex_type), playlistEntryMatcher - ); + constraint, + Config.regex_type, + playlistEntryMatcher); } -void Playlist::clearConstraint() +void Playlist::clearSearchConstraint() { m_search_predicate.clear(); } -bool Playlist::find(SearchDirection direction, bool wrap, bool skip_current) +bool Playlist::search(SearchDirection direction, bool wrap, bool skip_current) { - return search(w, m_search_predicate, direction, wrap, skip_current); + return ::search(w, m_search_predicate, direction, wrap, skip_current); } /***********************************************************************/ |