~mixxxdevelopers/mixxx/trunk

« back to all changes in this revision

Viewing changes to mixxx/src/library/rhythmboxfeature.cpp

  • Committer: Raffitea
  • Date: 2011-01-07 00:44:11 UTC
  • mfrom: (2616.1.25 traktor_library)
  • Revision ID: raffitea-20110107004411-lz9m8mnny3sf86rq
Merging from lp:~mixxxdevelopers/mixxx/traktor_library
* support for n-level childmodels in sidebar
* M3U and PLS playlist import

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
#include "library/rhythmboxtrackmodel.h"
7
7
#include "library/rhythmboxplaylistmodel.h"
8
8
#include "library/rhythmboxfeature.h"
 
9
#include "treeitem.h"
9
10
 
10
11
RhythmboxFeature::RhythmboxFeature(QObject* parent)
11
12
    : LibraryFeature(parent) {
34
35
    return QIcon(":/images/library/ic_library_rhythmbox.png");
35
36
}
36
37
 
37
 
QAbstractItemModel* RhythmboxFeature::getChildModel() {
 
38
TreeItemModel* RhythmboxFeature::getChildModel() {
38
39
    return &m_childModel;
39
40
}
40
41
 
62
63
        m_pPlaylistModelProxy->setFilterCaseSensitivity(Qt::CaseInsensitive);
63
64
        m_pPlaylistModelProxy->setSortCaseSensitivity(Qt::CaseInsensitive);
64
65
 
65
 
        QStringList list;
 
66
        TreeItem *rootItem = new TreeItem("$root","$root", this);
66
67
        for (int i = 0; i < m_pRhythmboxPlaylistModel->numPlaylists(); ++i) {
67
 
            list << m_pRhythmboxPlaylistModel->playlistTitle(i);
 
68
            QString playlist_name = m_pRhythmboxPlaylistModel->playlistTitle(i);
 
69
            TreeItem *item = new TreeItem(playlist_name, playlist_name, this,rootItem);
 
70
            
 
71
            rootItem->appendChild(item);
68
72
        }
69
 
        m_childModel.setStringList(list);
 
73
        m_childModel.setRootItem(rootItem);
70
74
    }
71
75
    emit(showTrackModel(m_pTrackModelProxy));
72
76
}