diff --git a/livesupport/modules/core/include/LiveSupport/Core/Playlist.h b/livesupport/modules/core/include/LiveSupport/Core/Playlist.h index e5e5ba679..edb893873 100644 --- a/livesupport/modules/core/include/LiveSupport/Core/Playlist.h +++ b/livesupport/modules/core/include/LiveSupport/Core/Playlist.h @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.38 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.39 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/include/LiveSupport/Core/Playlist.h,v $ ------------------------------------------------------------------------------*/ @@ -127,8 +127,8 @@ using namespace boost::posix_time; * <!ATTLIST playlist playlength NMTOKEN #IMPLIED > * * - * @author $Author: maroy $ - * @version $Revision: 1.38 $ + * @author $Author: fgerlits $ + * @version $Revision: 1.39 $ */ class Playlist : public Configurable, public Playable @@ -269,14 +269,6 @@ class Playlist : public Configurable, /** * Copy constructor. * - * Copies the pointers for all fields except elementList, - * savedCopy and metadata. A new copy of these three are created, - * but the playlists and strings contained in elementList and - * metadata are not duplicated, only a new pointer to them is created. - * The remaining fields are immutable; if you want to modify them, - * call the appropriate setter function with (a pointer to) an object - * with the new value. - * * @param otherPlaylist the playlist to be copied */ Playlist(const Playlist & otherPlaylist) diff --git a/livesupport/modules/core/src/Playlist.cxx b/livesupport/modules/core/src/Playlist.cxx index b106fd5d5..f0d8c5188 100644 --- a/livesupport/modules/core/src/Playlist.cxx +++ b/livesupport/modules/core/src/Playlist.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.37 $ + Version : $Revision: 1.38 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/Playlist.cxx,v $ ------------------------------------------------------------------------------*/ @@ -147,15 +147,20 @@ static const std::string xmlNamespaceUri *----------------------------------------------------------------------------*/ Playlist :: Playlist(const Playlist & otherPlaylist) throw () - : Playable(PlaylistType) + : Playable(PlaylistType), + id (otherPlaylist.id), + title (otherPlaylist.title), + playlength(otherPlaylist.playlength), + uri (otherPlaylist.uri), + token (otherPlaylist.token) { - id = otherPlaylist.id; - title = otherPlaylist.title; - playlength = otherPlaylist.playlength; - uri = otherPlaylist.uri; - token = otherPlaylist.token; - - elementList.reset(new PlaylistElementListType(*otherPlaylist.elementList)); + elementList.reset(new PlaylistElementListType); + const_iterator it; + for (it = otherPlaylist.begin(); it != otherPlaylist.end(); ++it) { + Ptr::Ref otherElement(new PlaylistElement( + *it->second )); + elementList->insert(std::make_pair(it->first, otherElement)); + } if (otherPlaylist.savedCopy) { savedCopy.reset(new Playlist(*otherPlaylist.savedCopy)); @@ -177,12 +182,11 @@ Playlist :: Playlist(Ptr::Ref id, Ptr::Ref playlength, Ptr::Ref uri) throw () - : Playable(PlaylistType) + : Playable(PlaylistType), + id(id), + uri(uri) { - this->id = id; this->title.reset(new Glib::ustring("")); - this->playlength = playlength; - this->uri = uri; elementList.reset(new PlaylistElementListType); @@ -199,13 +203,10 @@ Playlist :: Playlist(Ptr::Ref id, Ptr::Ref playlength, Ptr::Ref uri) throw () - : Playable(PlaylistType) + : Playable(PlaylistType), + id(id), + uri(uri) { - this->id = id; - this->title = title; - this->playlength = playlength; - this->uri = uri; - elementList.reset(new PlaylistElementListType); setTitle(title);