X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fsession_playlists.cc;h=649d42902bfa4f846a840c9c8c7ba17913ce858e;hb=884cb355230d293233e599bdfebae7f67684a48e;hp=b586ab196ebd318d65f09d9951fe86fa815664ac;hpb=0da34e65e3470b1c2298ddf571df6356d0d42bd8;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) {