diff options
author | Max Kellermann <max@duempel.org> | 2013-08-10 18:02:44 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-09-04 18:14:22 +0200 |
commit | 29030b54c98b0aee65fbc10ebf7ba36bed98c02c (patch) | |
tree | 79766830b55ebca38ddbce84d8d548227eedb69e /src/Directory.cxx | |
parent | c9fcc7f14860777458153eb2d13c773ccfa1daa2 (diff) | |
download | mpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.tar.gz mpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.tar.xz mpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.zip |
util/Error: new error passing library
Replaces GLib's GError.
Diffstat (limited to '')
-rw-r--r-- | src/Directory.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Directory.cxx b/src/Directory.cxx index 6a0da2597..261d16385 100644 --- a/src/Directory.cxx +++ b/src/Directory.cxx @@ -24,6 +24,7 @@ #include "DatabaseLock.hxx" #include "SongSort.hxx" #include "Song.hxx" +#include "util/Error.hxx" extern "C" { #include "util/list_sort.h" @@ -300,34 +301,34 @@ bool Directory::Walk(bool recursive, const SongFilter *filter, VisitDirectory visit_directory, VisitSong visit_song, VisitPlaylist visit_playlist, - GError **error_r) const + Error &error) const { - assert(error_r == NULL || *error_r == NULL); + assert(!error.IsDefined()); if (visit_song) { Song *song; directory_for_each_song(song, this) if ((filter == nullptr || filter->Match(*song)) && - !visit_song(*song, error_r)) + !visit_song(*song, error)) return false; } if (visit_playlist) { for (const PlaylistInfo &p : playlists) - if (!visit_playlist(p, *this, error_r)) + if (!visit_playlist(p, *this, error)) return false; } Directory *child; directory_for_each_child(child, this) { if (visit_directory && - !visit_directory(*child, error_r)) + !visit_directory(*child, error)) return false; if (recursive && !child->Walk(recursive, filter, visit_directory, visit_song, visit_playlist, - error_r)) + error)) return false; } |