aboutsummaryrefslogtreecommitdiffstats
path: root/src/directory.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-02-12 17:50:30 +0100
committerMax Kellermann <max@duempel.org>2012-02-12 17:50:30 +0100
commitac3ad452c03292e4c57b0d0e21c2dd407eb03a27 (patch)
tree10e12f06f7a62a0cab6eb0bf06a4e8a09e2d0d78 /src/directory.c
parent027c01511cfb8eac1a2e3f9fc54cfbb2bf968870 (diff)
downloadmpd-ac3ad452c03292e4c57b0d0e21c2dd407eb03a27.tar.gz
mpd-ac3ad452c03292e4c57b0d0e21c2dd407eb03a27.tar.xz
mpd-ac3ad452c03292e4c57b0d0e21c2dd407eb03a27.zip
playlist_vector: use the list_head library
Diffstat (limited to 'src/directory.c')
-rw-r--r--src/directory.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/directory.c b/src/directory.c
index 29991e60d..12d61a81e 100644
--- a/src/directory.c
+++ b/src/directory.c
@@ -21,6 +21,7 @@
#include "directory.h"
#include "song.h"
#include "song_sort.h"
+#include "playlist_vector.h"
#include "path.h"
#include "util/list_sort.h"
#include "db_visitor.h"
@@ -45,11 +46,11 @@ directory_new(const char *path, struct directory *parent)
sizeof(directory->path) + pathlen + 1);
INIT_LIST_HEAD(&directory->children);
INIT_LIST_HEAD(&directory->songs);
+ INIT_LIST_HEAD(&directory->playlists);
+
directory->parent = parent;
memcpy(directory->path, path, pathlen + 1);
- playlist_vector_init(&directory->playlists);
-
return directory;
}
@@ -282,9 +283,8 @@ directory_walk(const struct directory *directory, bool recursive,
}
if (visitor->playlist != NULL) {
- const struct playlist_vector *pv = &directory->playlists;
- for (const struct playlist_metadata *i = pv->head;
- i != NULL; i = i->next)
+ struct playlist_metadata *i;
+ directory_for_each_playlist(i, directory)
if (!visitor->playlist(i, directory, ctx, error_r))
return false;
}