From b3d32cd1275310aa7c536c2703abdd3b2f237b9d Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Thu, 26 Oct 2017 16:37:20 +0000 Subject: added copy operator to PlayListTrack git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@7647 90c681e8-e032-0410-971d-27865f9a5e38 --- src/qmmpui/playlisttrack.cpp | 12 ++++++++++++ src/qmmpui/playlisttrack.h | 10 +++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/qmmpui/playlisttrack.cpp b/src/qmmpui/playlisttrack.cpp index ad75d33f9..b13a91131 100644 --- a/src/qmmpui/playlisttrack.cpp +++ b/src/qmmpui/playlisttrack.cpp @@ -71,6 +71,18 @@ PlayListTrack::~PlayListTrack() qWarning("PlayListTrack: deleting busy track"); } +PlayListTrack &PlayListTrack::operator=(const PlayListTrack &other) +{ + m_formattedTitles = other.m_formattedTitles; + m_group = other.m_group; + m_formattedLength = other.m_formattedLength; + m_titleFormats = other.m_titleFormats; + m_groupFormat = other.m_groupFormat; + setSelected(other.isSelected()); + m_length = other.m_length; + m_formattedLength = other.m_formattedLength; +} + void PlayListTrack::updateMetaData(const QMap &metaData) { QMap ::operator =(metaData); diff --git a/src/qmmpui/playlisttrack.h b/src/qmmpui/playlisttrack.h index 1760b864e..6677a91d2 100644 --- a/src/qmmpui/playlisttrack.h +++ b/src/qmmpui/playlisttrack.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2013-2014 by Ilya Kotov * + * Copyright (C) 2013-2017 by Ilya Kotov * * forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -41,9 +41,9 @@ public: */ PlayListTrack(); /*! - * Constructs a new PlayListTrack that is a copy of the given \b item + * Constructs a new PlayListTrack that is a copy of the given track \b other */ - PlayListTrack(const PlayListTrack &item); + PlayListTrack(const PlayListTrack &other); /*! * Constructs plalist item with given metadata. * @param info Media file information. @@ -53,6 +53,10 @@ public: * Object destructor. */ virtual ~PlayListTrack(); + /*! + * Assigns \b other to this track and returns a reference to this track. + */ + PlayListTrack &operator=(const PlayListTrack &other); /*! * Returns formatted title of the item. * @param column Number of column. -- cgit v1.2.3-13-gbd6f