aboutsummaryrefslogtreecommitdiff
path: root/src/qmmpui
diff options
context:
space:
mode:
Diffstat (limited to 'src/qmmpui')
-rw-r--r--src/qmmpui/playlistmanager.cpp4
-rw-r--r--src/qmmpui/playlistmanager.h4
-rw-r--r--src/qmmpui/playlistmodel.cpp12
-rw-r--r--src/qmmpui/playlistmodel.h21
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:
/*!