Fix small issue with the playlist unique name patch.
[ardour.git] / libs / ardour / playlist.cc
index 3aa14a055850f42ec09c6494881b502a569133bc..9ed103b67ce8e8ac8d81e3efc4e4e2f204d470eb 100644 (file)
@@ -282,7 +282,17 @@ Playlist::set_name (string str)
                return;
        }
 
-       _name = str; 
+       if (str == _name) {
+               return;
+       }
+
+       string name = str;
+
+       while (_session.playlist_by_name(name) != 0) {
+               name = bump_name_once(name);
+       }
+
+       _name = name; 
        NameChanged(); /* EMIT SIGNAL */
 }