diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2017-10-26 16:37:20 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2017-10-26 16:37:20 +0000 |
| commit | b3d32cd1275310aa7c536c2703abdd3b2f237b9d (patch) | |
| tree | 7cb900a4348876b59c0266dbd5fa625520157e75 | |
| parent | d47d0614292801262faa2251d1de5f35b1d832aa (diff) | |
| download | qmmp-b3d32cd1275310aa7c536c2703abdd3b2f237b9d.tar.gz qmmp-b3d32cd1275310aa7c536c2703abdd3b2f237b9d.tar.bz2 qmmp-b3d32cd1275310aa7c536c2703abdd3b2f237b9d.zip | |
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
| -rw-r--r-- | src/qmmpui/playlisttrack.cpp | 12 | ||||
| -rw-r--r-- | src/qmmpui/playlisttrack.h | 10 |
2 files changed, 19 insertions, 3 deletions
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 <Qmmp::MetaData, QString> &metaData) { QMap <Qmmp::MetaData, QString>::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. @@ -54,6 +54,10 @@ public: */ 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. */ |
