new port design, probably about 90% done (i.e it mostly works and this commit is...
[ardour.git] / libs / ardour / named_selection.cc
index ecce09692f20ccc8d7a224247688775ba46fd08e..fbb4b748df5176ed71e7d9c93d6c149e8ca5dcf2 100644 (file)
@@ -15,7 +15,6 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id$
 */
 
 #include <pbd/failed_constructor.h>
@@ -40,8 +39,18 @@ NamedSelection::NamedSelection (string n, PlaylistList& l)
 {
        playlists = l;
        for (PlaylistList::iterator i = playlists.begin(); i != playlists.end(); ++i) {
+               string new_name;
+
+               /* rename playlists to reflect our ownership */
+
+               new_name = name;
+               new_name += '/';
+               new_name += (*i)->name();
+
+               (*i)->set_name (new_name);
                (*i)->use();
        }
+
        NamedSelectionCreated (this);
 }
 
@@ -90,7 +99,8 @@ NamedSelection::NamedSelection (Session& session, const XMLNode& node)
 NamedSelection::~NamedSelection ()
 {
        for (PlaylistList::iterator i = playlists.begin(); i != playlists.end(); ++i) {
-               (*i)->release();
+               (*i)->release ();
+               (*i)->GoingAway ();
        }
 }