X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fsession_playlists.cc;h=649d42902bfa4f846a840c9c8c7ba17913ce858e;hb=e77729125ec262b6a01e8fc22b236995cd37a7f6;hp=b586ab196ebd318d65f09d9951fe86fa815664ac;hpb=08371ae2cf6231bbb8522645d14add41ffa9c1c0;p=ardour.git diff --git a/libs/ardour/session_playlists.cc b/libs/ardour/session_playlists.cc index b586ab196e..649d42902b 100644 --- a/libs/ardour/session_playlists.cc +++ b/libs/ardour/session_playlists.cc @@ -333,15 +333,39 @@ SessionPlaylists::maybe_delete_unused (boost::function > playlists_tbd; + bool delete_remaining = false; + bool keep_remaining = false; + for (List::iterator x = unused_playlists.begin(); x != unused_playlists.end(); ++x) { + if (keep_remaining) { + break; + } + + if (delete_remaining) { + playlists_tbd.push_back (*x); + continue; + } + int status = ask (*x); switch (status) { case -1: + // abort return true; - case 0: + case -2: + // keep this and all later + keep_remaining = true; + break; + + case 2: + // delete this and all later + delete_remaining = true; + // no break; + + case 1: + // delete this playlists_tbd.push_back (*x); break; @@ -465,7 +489,7 @@ SessionPlaylists::playlists_for_track (boost::shared_ptr tr) const { vector > pl; get (pl); - + vector > pl_tr; for (vector >::iterator i = pl.begin(); i != pl.end(); ++i) {