diff options
| -rw-r--r-- | src/qmmpui/playlistmodel.cpp | 20 | ||||
| -rw-r--r-- | src/qmmpui/playlistmodel.h | 10 |
2 files changed, 16 insertions, 14 deletions
diff --git a/src/qmmpui/playlistmodel.cpp b/src/qmmpui/playlistmodel.cpp index 9eb247349..371d10701 100644 --- a/src/qmmpui/playlistmodel.cpp +++ b/src/qmmpui/playlistmodel.cpp @@ -481,6 +481,11 @@ int PlayListModel::firstSelectedLower(int row) return -1; } +int PlayListModel::totalLength() const +{ + return m_total_length; +} + void PlayListModel::moveItems(int from, int to) { // Get rid of useless work @@ -567,17 +572,20 @@ QList<int> PlayListModel::selectedIndexes() const QList< PlayListItem * > PlayListModel::selectedItems() const { - QList<PlayListItem*>selected_items; - for (int i = 0;i<m_items.count();i++) + QList<PlayListItem*> selected_items; + foreach(PlayListItem *item, m_items) { - if (m_items[i]->isSelected()) - { - selected_items.append(m_items[i]); - } + if(item->isSelected()) + selected_items.append(item); } return selected_items; } +QList<PlayListItem *> PlayListModel::items() const +{ + return m_items; +} + void PlayListModel::addToQueue() { QList<PlayListItem*> selected_items = selectedItems(); diff --git a/src/qmmpui/playlistmodel.h b/src/qmmpui/playlistmodel.h index 6ea3efa33..394c41e2c 100644 --- a/src/qmmpui/playlistmodel.h +++ b/src/qmmpui/playlistmodel.h @@ -235,10 +235,7 @@ public: /*! * Returns list of all \b PlayListItem pointers. */ - QList<PlayListItem*> items() const - { - return m_items; - } + QList<PlayListItem*> items() const; /*! * Returns number of first item that selected upper the \b row item. */ @@ -250,10 +247,7 @@ public: /*! * Returns total lenght in seconds of all songs. */ - int totalLength()const - { - return m_total_length; - } + int totalLength() const; /*! * Loads playlist with \b f_name name. */ |
