From 0d388c78e8cb52ce8030fa635c6222ce11244dcd Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Wed, 17 Jul 2013 17:45:42 +0000 Subject: removed useless code git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3554 90c681e8-e032-0410-971d-27865f9a5e38 --- src/qmmpui/metadataformatter.cpp | 4 ++-- src/qmmpui/metadataformatter.h | 4 ++-- src/qmmpui/playlistitem.cpp | 19 ++++++------------- src/qmmpui/playlistitem.h | 11 ++--------- 4 files changed, 12 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/qmmpui/metadataformatter.cpp b/src/qmmpui/metadataformatter.cpp index ac7504b19..67442e845 100644 --- a/src/qmmpui/metadataformatter.cpp +++ b/src/qmmpui/metadataformatter.cpp @@ -47,12 +47,12 @@ MetaDataFormatter::MetaDataFormatter(const QString &format) m_format = format; } -QString MetaDataFormatter::parse(PlayListItem *item) +QString MetaDataFormatter::parse(const PlayListItem *item) { return parse(*item, item->length()); } -QString MetaDataFormatter::parse(const QMap metaData, qint64 length) +QString MetaDataFormatter::parse(const QMap &metaData, qint64 length) { QString title = m_format; title.replace("\\(", "%28"); diff --git a/src/qmmpui/metadataformatter.h b/src/qmmpui/metadataformatter.h index 2e442394c..0849a1117 100644 --- a/src/qmmpui/metadataformatter.h +++ b/src/qmmpui/metadataformatter.h @@ -55,13 +55,13 @@ public: /*! * Converts metadata of item \b item to one string using template. */ - QString parse(PlayListItem *item); + QString parse(const PlayListItem *item); /*! * Converts metadata to one string using template. * @param metaData Metadata array. * @param length Length in seconds. */ - QString parse(const QMap metaData, qint64 length = 0); + QString parse(const QMap &metaData, qint64 length = 0); /*! * Returns formatted length (example: 05:02:03). * \param length Length in seconds. diff --git a/src/qmmpui/playlistitem.cpp b/src/qmmpui/playlistitem.cpp index edb676cbc..3956a1d1a 100644 --- a/src/qmmpui/playlistitem.cpp +++ b/src/qmmpui/playlistitem.cpp @@ -27,7 +27,6 @@ PlayListItem::PlayListItem() : QMap(), m_flag(FREE) m_info = 0; m_length = 0; m_selected = false; - m_current = false; } PlayListItem::PlayListItem(const PlayListItem &other) : QMap(other), @@ -39,7 +38,6 @@ PlayListItem::PlayListItem(const PlayListItem &other) : QMap(info { setLength(m_length = info->length()); m_selected = false; - m_current = false; m_info = info; insert(Qmmp::URL, m_info->path()); } @@ -69,16 +66,6 @@ bool PlayListItem::isSelected() const return m_selected; } -void PlayListItem::setCurrent(bool yes) -{ - m_current = yes; -} - -bool PlayListItem::isCurrent() const -{ - return m_current; -} - void PlayListItem::setFlag(FLAGS f) { m_flag = f; @@ -115,6 +102,12 @@ void PlayListItem::updateTags() delete list.takeLast(); } +const QString PlayListItem::groupName() const +{ + MetaDataFormatter f("%p"); + return f.parse(this); +} + const QString PlayListItem::formattedTitle() { if(m_formattedTitle.isEmpty()) diff --git a/src/qmmpui/playlistitem.h b/src/qmmpui/playlistitem.h index 6cb8dbb84..ab8b4170d 100644 --- a/src/qmmpui/playlistitem.h +++ b/src/qmmpui/playlistitem.h @@ -69,14 +69,6 @@ public: * Return \b true if item is selected, otherwise returns \b false. */ bool isSelected() const; - /*! - * It is used by PlayListModel class. - */ - void setCurrent(bool yes); - /*! - * Returns \b true if the item is the current item; otherwise returns returns \b false. - */ - bool isCurrent() const; /*! * Returns current state of the playlist item. */ @@ -120,13 +112,14 @@ public: */ void updateTags(); + const QString groupName() const; + private: void readMetadata(); QString m_formattedTitle; QString m_formattedLength; FileInfo *m_info; bool m_selected; - bool m_current; FLAGS m_flag; qint64 m_length; }; -- cgit v1.2.3-13-gbd6f