13
0

prepare "delete all playlists" cleanup option

This commit is contained in:
Robin Gareus 2015-11-21 21:11:45 +01:00
parent 778e656bd7
commit 20262abe7f

View File

@ -333,15 +333,28 @@ SessionPlaylists::maybe_delete_unused (boost::function<int(boost::shared_ptr<Pla
{ {
vector<boost::shared_ptr<Playlist> > playlists_tbd; vector<boost::shared_ptr<Playlist> > playlists_tbd;
bool delete_all = false;
for (List::iterator x = unused_playlists.begin(); x != unused_playlists.end(); ++x) { for (List::iterator x = unused_playlists.begin(); x != unused_playlists.end(); ++x) {
if (delete_all) {
playlists_tbd.push_back (*x);
continue;
}
int status = ask (*x); int status = ask (*x);
switch (status) { switch (status) {
case -1: case -1:
// abort
return true; return true;
case 0: case 2:
// delete this and all later
delete_all = true;
// no break;
case 1:
// delete this
playlists_tbd.push_back (*x); playlists_tbd.push_back (*x);
break; break;