aboutsummaryrefslogtreecommitdiffstats
path: root/src/Directory.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-08-29 19:27:03 +0200
committerMax Kellermann <max@duempel.org>2012-08-29 20:19:02 +0200
commit333d226ed0044cf6a6387e03805be2d7f6dac6f2 (patch)
tree7acb6fc795fcd2bb8aa75c16172de1ff7a761e8f /src/Directory.cxx
parent04a9dec9525a58d077da71a84655cb45b7838520 (diff)
downloadmpd-333d226ed0044cf6a6387e03805be2d7f6dac6f2.tar.gz
mpd-333d226ed0044cf6a6387e03805be2d7f6dac6f2.tar.xz
mpd-333d226ed0044cf6a6387e03805be2d7f6dac6f2.zip
SongFilter: convert to a C++ class
Diffstat (limited to 'src/Directory.cxx')
-rw-r--r--src/Directory.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Directory.cxx b/src/Directory.cxx
index d4564d69e..eeba903d1 100644
--- a/src/Directory.cxx
+++ b/src/Directory.cxx
@@ -291,7 +291,7 @@ directory_sort(struct directory *directory)
}
bool
-directory::Walk(bool recursive, const locate_item_list *match,
+directory::Walk(bool recursive, const SongFilter *filter,
VisitDirectory visit_directory, VisitSong visit_song,
VisitPlaylist visit_playlist,
GError **error_r) const
@@ -301,8 +301,7 @@ directory::Walk(bool recursive, const locate_item_list *match,
if (visit_song) {
struct song *song;
directory_for_each_song(song, this)
- if ((match == NULL ||
- locate_list_song_match(song, match)) &&
+ if ((filter == nullptr || filter->Match(*song)) &&
!visit_song(*song, error_r))
return false;
}
@@ -321,7 +320,7 @@ directory::Walk(bool recursive, const locate_item_list *match,
return false;
if (recursive &&
- !child->Walk(recursive, match,
+ !child->Walk(recursive, filter,
visit_directory, visit_song, visit_playlist,
error_r))
return false;