From d0fb9b2155edb5c49abb77156a11dbb82501595b Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Fri, 6 Feb 2015 14:11:58 -0500 Subject: [PATCH] playlist: Give PlaylistQueues a clear() function This is used to clear the queue before populating it with a different playlist. Signed-off-by: Anna Schumaker --- core/playlist.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/playlist.cpp b/core/playlist.cpp index 78129889..ff77dede 100644 --- a/core/playlist.cpp +++ b/core/playlist.cpp @@ -17,13 +17,17 @@ public: set_flag(Q_NO_SORT); } + void clear() + { + while (size() > 0) + del((unsigned)0); + } + void fill(IndexEntry *ent) { std::set::iterator it; - while (size() > 0) - del((unsigned)0); - + clear(); for (it = ent->begin(); it != ent->end(); it++) add(tags :: get_track(*it)); }