Add dividers to Grooveshark tree, to visualise better each type of item

This commit is contained in:
Arnaud Bienner 2011-11-24 23:42:22 +01:00
parent 73a823d190
commit 7a188787de
2 changed files with 12 additions and 1 deletions

View File

@ -515,6 +515,10 @@ void GroovesharkService::EnsureItemsCreated() {
InternetModel::Role_PlayBehaviour);
root_->appendRow(search_);
QStandardItem* popular_divider = new QStandardItem(tr("Popular songs"));
popular_divider->setData(true, InternetModel::Role_IsDivider);
root_->appendRow(popular_divider);
popular_month_ = new QStandardItem(QIcon(":/star-on.png"), tr("Popular songs of the Month"));
popular_month_->setData(InternetModel::Type_UserPlaylist, InternetModel::Role_Type);
popular_month_->setData(true, InternetModel::Role_CanLazyLoad);
@ -529,6 +533,10 @@ void GroovesharkService::EnsureItemsCreated() {
InternetModel::Role_PlayBehaviour);
root_->appendRow(popular_today_);
QStandardItem* playlists_divider = new QStandardItem(tr("Playlists"));
playlists_divider->setData(true, InternetModel::Role_IsDivider);
root_->appendRow(playlists_divider);
favorites_ = new QStandardItem(QIcon(":/last.fm/love.png"), tr("Favorites"));
favorites_->setData(InternetModel::Type_UserPlaylist, InternetModel::Role_Type);
favorites_->setData(UserFavorites, Role_PlaylistType);

View File

@ -20,6 +20,7 @@
#include "core/backgroundthread.h"
#include "core/song.h"
#include "library/librarymodel.h"
#include "playlist/playlistitem.h"
#include "ui/settingsdialog.h"
#include "widgets/multiloadingindicator.h"
@ -79,7 +80,9 @@ public:
// (e.g. changing remote playlists)
Role_CanBeModified,
RoleCount
RoleCount,
Role_IsDivider = LibraryModel::Role_IsDivider,
};
enum Type {