diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2010-09-26 07:22:18 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2010-09-26 07:22:18 +0000 |
| commit | 4da0809944474ccd059d0ab89d17f500c8d8d8ea (patch) | |
| tree | f87d3fc804cf41aaefc8e2fe3f01a6b8d386e2fb | |
| parent | b9131238a365e242f1e7dfc37e4aaeeb3fe14984 (diff) | |
| download | qmmp-4da0809944474ccd059d0ab89d17f500c8d8d8ea.tar.gz qmmp-4da0809944474ccd059d0ab89d17f500c8d8d8ea.tar.bz2 qmmp-4da0809944474ccd059d0ab89d17f500c8d8d8ea.zip | |
fixed 'copy selection' patch (Avihay Baratz)
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1914 90c681e8-e032-0410-971d-27865f9a5e38
| -rw-r--r-- | src/qmmpui/playlistitem.cpp | 11 | ||||
| -rw-r--r-- | src/qmmpui/playlistitem.h | 4 | ||||
| -rw-r--r-- | src/ui/playlist.cpp | 8 |
3 files changed, 15 insertions, 8 deletions
diff --git a/src/qmmpui/playlistitem.cpp b/src/qmmpui/playlistitem.cpp index d13d7ab18..4ff602948 100644 --- a/src/qmmpui/playlistitem.cpp +++ b/src/qmmpui/playlistitem.cpp @@ -32,6 +32,17 @@ PlayListItem::PlayListItem() : AbstractPlaylistItem(), m_flag(FREE) m_current = false; } +PlayListItem::PlayListItem(const PlayListItem &other) : AbstractPlaylistItem(other), m_flag(other.m_flag) +{ + m_title = other.m_title; + if (other.m_info) + { + m_info = new FileInfo(*(other.m_info)); + } + m_selected = other.m_selected; + m_current = other.m_current; +} + PlayListItem::PlayListItem(FileInfo *info) : AbstractPlaylistItem(), m_flag(FREE) { m_selected = false; diff --git a/src/qmmpui/playlistitem.h b/src/qmmpui/playlistitem.h index c1bec3e38..9ad51ee67 100644 --- a/src/qmmpui/playlistitem.h +++ b/src/qmmpui/playlistitem.h @@ -50,6 +50,10 @@ public: */ PlayListItem(); /*! + * Constructs a new PlayListItem that is a copy of the given \b item + */ + PlayListItem(const PlayListItem &item); + /*! * Constructs plalist item with given metadata. * @param info Media file information. */ diff --git a/src/ui/playlist.cpp b/src/ui/playlist.cpp index 7786ec249..984b75e3b 100644 --- a/src/ui/playlist.cpp +++ b/src/ui/playlist.cpp @@ -665,14 +665,6 @@ void PlayList::copySelectedMenuActionTriggered( QAction * action) QList <PlayListItem *> theCopy; foreach(PlayListItem *item, m_pl_manager->selectedPlayList()->getSelectedItems()) { - item->updateTags(); - //NOTE: explicitly using default copy constructor default copy - //constructor doesn't do a deep copy so *m_info points to where the - //original did.this may very well be unnecessary, but I call - //updateTags() for readMetadata() to zero it before the copy - //TODO: If the PlayListItem default copy constructor isn't used - //elsewhere, a default copy constructor should be written that takes - //care of m_info and remove the line above PlayListItem *newItem = new PlayListItem(*item); theCopy << newItem; } |
