aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2015-07-01 19:53:31 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2015-07-01 19:53:31 +0000
commitbcf7e323d2f5ffc908640eade6edb3d2a8fcc758 (patch)
treed6bbff5e43230ec8dbf1a6c1a2f4b755d66c7886
parente0aef68824bce7487669e37d90fab472dba7c11d (diff)
downloadqmmp-bcf7e323d2f5ffc908640eade6edb3d2a8fcc758.tar.gz
qmmp-bcf7e323d2f5ffc908640eade6edb3d2a8fcc758.tar.bz2
qmmp-bcf7e323d2f5ffc908640eade6edb3d2a8fcc758.zip
refactoring
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@5204 90c681e8-e032-0410-971d-27865f9a5e38
-rw-r--r--src/qmmpui/playlistitem.cpp5
-rw-r--r--src/qmmpui/playlistitem.h5
-rw-r--r--src/qmmpui/playlisttrack.cpp13
-rw-r--r--src/qmmpui/playlisttrack.h5
4 files changed, 22 insertions, 6 deletions
diff --git a/src/qmmpui/playlistitem.cpp b/src/qmmpui/playlistitem.cpp
index 101b8a497..9c1b03d99 100644
--- a/src/qmmpui/playlistitem.cpp
+++ b/src/qmmpui/playlistitem.cpp
@@ -24,7 +24,6 @@
PlayListItem::PlayListItem()
{
- m_track_index = -1;
m_selected = false;
}
@@ -43,12 +42,12 @@ bool PlayListItem::isSelected() const
void PlayListItem::setTrackIndex(int number)
{
- m_track_index = number;
+ Q_UNUSED(number);
}
int PlayListItem::trackIndex() const
{
- return m_track_index;
+ return -1;
}
diff --git a/src/qmmpui/playlistitem.h b/src/qmmpui/playlistitem.h
index cfe9ca1f3..b5af7384d 100644
--- a/src/qmmpui/playlistitem.h
+++ b/src/qmmpui/playlistitem.h
@@ -64,13 +64,12 @@ public:
*/
virtual bool isGroup() const = 0;
- void setTrackIndex(int number);
+ virtual void setTrackIndex(int number);
- int trackIndex() const;
+ virtual int trackIndex() const;
private:
bool m_selected;
- int m_track_index;
};
#endif
diff --git a/src/qmmpui/playlisttrack.cpp b/src/qmmpui/playlisttrack.cpp
index e8fbc7ec1..58a8245c0 100644
--- a/src/qmmpui/playlisttrack.cpp
+++ b/src/qmmpui/playlisttrack.cpp
@@ -26,6 +26,7 @@
PlayListTrack::PlayListTrack() : QMap<Qmmp::MetaData, QString>(), PlayListItem()
{
+ m_track_index = -1;
m_settings = QmmpUiSettings::instance();
m_helper = MetaDataHelper::instance();
m_length = 0;
@@ -36,6 +37,7 @@ PlayListTrack::PlayListTrack() : QMap<Qmmp::MetaData, QString>(), PlayListItem()
PlayListTrack::PlayListTrack(const PlayListTrack &other) : QMap<Qmmp::MetaData, QString>(other),
PlayListItem()
{
+ m_track_index = -1;
m_settings = QmmpUiSettings::instance();
m_helper = MetaDataHelper::instance();
m_refCount = 0;
@@ -54,6 +56,7 @@ PlayListTrack::PlayListTrack(const PlayListTrack &other) : QMap<Qmmp::MetaData,
PlayListTrack::PlayListTrack(FileInfo *info) : QMap<Qmmp::MetaData, QString>(info->metaData()),
PlayListItem()
{
+ m_track_index = -1;
m_settings = QmmpUiSettings::instance();
m_helper = MetaDataHelper::instance();
setLength(m_length = info->length());
@@ -105,6 +108,16 @@ bool PlayListTrack::isGroup() const
return false;
}
+void PlayListTrack::setTrackIndex(int track_index)
+{
+ m_track_index = track_index;
+}
+
+int PlayListTrack::trackIndex() const
+{
+ return m_track_index;
+}
+
void PlayListTrack::beginUsage()
{
m_refCount++;
diff --git a/src/qmmpui/playlisttrack.h b/src/qmmpui/playlisttrack.h
index 4c0fe9d2d..304445d20 100644
--- a/src/qmmpui/playlisttrack.h
+++ b/src/qmmpui/playlisttrack.h
@@ -93,6 +93,10 @@ public:
*/
bool isGroup() const;
+ void setTrackIndex(int track_index);
+
+ int trackIndex() const;
+
void beginUsage();
void endUsage();
@@ -117,6 +121,7 @@ private:
QmmpUiSettings *m_settings;
qint64 m_length;
int m_refCount;
+ int m_track_index;
bool m_sheduledForDeletion;
MetaDataHelper *m_helper;
};