diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2017-08-27 19:49:21 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2017-08-27 19:49:21 +0000 |
| commit | 42e6605515468b0eb5ecfcffc0b032b68a65df0a (patch) | |
| tree | bd8aa7d98d3db16e80ae487bc0a5f0bcfaa6a715 /src/qmmpui/playlistmodel.cpp | |
| parent | a8de6bc53396f50aa3f7f0af05e6bd91824f6a33 (diff) | |
| download | qmmp-42e6605515468b0eb5ecfcffc0b032b68a65df0a.tar.gz qmmp-42e6605515468b0eb5ecfcffc0b032b68a65df0a.tar.bz2 qmmp-42e6605515468b0eb5ecfcffc0b032b68a65df0a.zip | |
added PlayListModel::findTracks function
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@7390 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/qmmpui/playlistmodel.cpp')
| -rw-r--r-- | src/qmmpui/playlistmodel.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/qmmpui/playlistmodel.cpp b/src/qmmpui/playlistmodel.cpp index 4710d1066..862d498c9 100644 --- a/src/qmmpui/playlistmodel.cpp +++ b/src/qmmpui/playlistmodel.cpp @@ -425,6 +425,25 @@ PlayListTrack *PlayListModel::findTrack(int track_index) const return m_container->findTrack(track_index); } +QList<PlayListItem *> PlayListModel::findTracks(const QString &str) const +{ + QList<PlayListItem *> items; + PlayListItem *item = 0; + if(str.isEmpty()) + return items; + + for(int i = 0; i < m_container->count(); ++i) + { + item = m_container->item(i); + if(item->isGroup()) + continue; + + if(!item->formattedTitles().filter(str, Qt::CaseInsensitive).isEmpty()) + items.append(item); + } + return items; +} + void PlayListModel::setSelected(int index, bool selected) { m_container->setSelected(index, selected); |
