diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2010-03-11 17:59:44 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2010-03-11 17:59:44 +0000 |
| commit | 542c1d2d3a26ce23b1d0668011b420db231334d2 (patch) | |
| tree | 412aa9a141d5500c38f547945fbb8f4fc5553caf /src/qmmpui | |
| parent | 677943a044c8dbbc17e3936d5f13471db280bf56 (diff) | |
| download | qmmp-542c1d2d3a26ce23b1d0668011b420db231334d2.tar.gz qmmp-542c1d2d3a26ce23b1d0668011b420db231334d2.tar.bz2 qmmp-542c1d2d3a26ce23b1d0668011b420db231334d2.zip | |
prepare for duplicates search
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1618 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/qmmpui')
| -rw-r--r-- | src/qmmpui/playlistmanager.cpp | 4 | ||||
| -rw-r--r-- | src/qmmpui/playlistmanager.h | 4 | ||||
| -rw-r--r-- | src/qmmpui/playlistmodel.cpp | 12 | ||||
| -rw-r--r-- | src/qmmpui/playlistmodel.h | 21 |
4 files changed, 33 insertions, 8 deletions
diff --git a/src/qmmpui/playlistmanager.cpp b/src/qmmpui/playlistmanager.cpp index 7aac05b41..0d240c2a6 100644 --- a/src/qmmpui/playlistmanager.cpp +++ b/src/qmmpui/playlistmanager.cpp @@ -453,7 +453,7 @@ void PlayListManager::addToQueue() m_selected->addToQueue(); } -void PlayListManager::clearInvalidItems() +void PlayListManager::removeInvalidItems() { - m_selected->clearInvalidItems(); + m_selected->removeInvalidItems(); } diff --git a/src/qmmpui/playlistmanager.h b/src/qmmpui/playlistmanager.h index db887acc5..0a33b577a 100644 --- a/src/qmmpui/playlistmanager.h +++ b/src/qmmpui/playlistmanager.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009 by Ilya Kotov * + * Copyright (C) 2009-2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -190,7 +190,7 @@ public slots: /*! * This is a convenience function and is the same as calling \b selectedPlayList()->clearInvalidItems() */ - void clearInvalidItems(); + void removeInvalidItems(); private: diff --git a/src/qmmpui/playlistmodel.cpp b/src/qmmpui/playlistmodel.cpp index 1db931f2f..01ec148f1 100644 --- a/src/qmmpui/playlistmodel.cpp +++ b/src/qmmpui/playlistmodel.cpp @@ -262,6 +262,16 @@ bool PlayListModel::isSelected(int row) return false; } +bool PlayListModel::contains(const QString &url) +{ + foreach (PlayListItem *item, m_items) + { + if(item->url() == url) + return true; + } + return false; +} + void PlayListModel::setSelected(int row, bool yes) { if (m_items.count() > row && row >= 0) @@ -897,7 +907,7 @@ void PlayListModel::preparePlayState() m_play_state->prepare(); } -void PlayListModel::clearInvalidItems() +void PlayListModel::removeInvalidItems() { foreach(PlayListItem *item, m_items) { diff --git a/src/qmmpui/playlistmodel.h b/src/qmmpui/playlistmodel.h index c26572fe4..d61dea152 100644 --- a/src/qmmpui/playlistmodel.h +++ b/src/qmmpui/playlistmodel.h @@ -108,8 +108,13 @@ public: * Object destructor. */ ~PlayListModel(); - + /*! + * Returns playlist name. + */ QString name() const; + /*! + * Sets the name of the playlist to \b name. + */ void setName(const QString &name); /*! * Returns number of items. @@ -119,7 +124,9 @@ public: * Returns the current item. */ PlayListItem* currentItem(); - + /*! + * Returns the next playing item or 0 if next item is unknown. + */ PlayListItem* nextItem(); /*! * Returns the row of the \b item @@ -249,6 +256,10 @@ public: */ bool isShuffle() const; /*! + * Returns \b true if the playlist contains an item with URL \b url; otherwise returns \b false. + */ + bool contains(const QString &url); + /*! * Enum of available sort modes */ enum SortMode @@ -388,7 +399,11 @@ public slots: /*! * Removes invalid items from playlist */ - void clearInvalidItems(); + void removeInvalidItems(); + /*! + * Removes duplicate items by URL. + */ + //void removeDuplicates(); private: /*! |
