diff options
author | Robin Gareus <robin@gareus.org> | 2015-11-21 21:11:45 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-11-21 21:11:45 +0100 |
commit | 20262abe7f1f73943ffa1dcf5bfb6599bee5d2a0 (patch) | |
tree | dadb480d173d1465ff044d078108e3192ef0228a /libs/ardour/session_playlists.cc | |
parent | 778e656bd77af8bacd8b27a7ca07e3fc145b05c0 (diff) |
prepare "delete all playlists" cleanup option
Diffstat (limited to 'libs/ardour/session_playlists.cc')
-rw-r--r-- | libs/ardour/session_playlists.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/libs/ardour/session_playlists.cc b/libs/ardour/session_playlists.cc index 8fdafad09d..cc2f1b25ab 100644 --- a/libs/ardour/session_playlists.cc +++ b/libs/ardour/session_playlists.cc @@ -333,15 +333,28 @@ SessionPlaylists::maybe_delete_unused (boost::function<int(boost::shared_ptr<Pla { vector<boost::shared_ptr<Playlist> > playlists_tbd; + bool delete_all = false; + 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); switch (status) { case -1: + // abort 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); break; |