diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2013-07-03 16:40:16 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2013-07-03 16:40:16 +0000 |
| commit | 9548b51896fd67e633605a10e52ef605741b98e7 (patch) | |
| tree | 62da017689742fc0da7dec7ab06416dcf7ce001d /src | |
| parent | 10cf99e346ecb30ce7a701ca062856cd18d05dea (diff) | |
| download | qmmp-9548b51896fd67e633605a10e52ef605741b98e7.tar.gz qmmp-9548b51896fd67e633605a10e52ef605741b98e7.tar.bz2 qmmp-9548b51896fd67e633605a10e52ef605741b98e7.zip | |
some api cleanup
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3535 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src')
| -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. */ |
