From 9548b51896fd67e633605a10e52ef605741b98e7 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Wed, 3 Jul 2013 16:40:16 +0000 Subject: some api cleanup git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3535 90c681e8-e032-0410-971d-27865f9a5e38 --- src/qmmpui/playlistmodel.cpp | 20 ++++++++++++++------ src/qmmpui/playlistmodel.h | 10 ++-------- 2 files changed, 16 insertions(+), 14 deletions(-) (limited to 'src') 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 PlayListModel::selectedIndexes() const QList< PlayListItem * > PlayListModel::selectedItems() const { - QListselected_items; - for (int i = 0;i 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 PlayListModel::items() const +{ + return m_items; +} + void PlayListModel::addToQueue() { QList 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 items() const - { - return m_items; - } + QList 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. */ -- cgit v1.2.3-13-gbd6f