From 7a188787de2b1a7bbd6dd75861b1396ee9e1d8be Mon Sep 17 00:00:00 2001 From: Arnaud Bienner Date: Thu, 24 Nov 2011 23:42:22 +0100 Subject: [PATCH] Add dividers to Grooveshark tree, to visualise better each type of item --- src/internet/groovesharkservice.cpp | 8 ++++++++ src/internet/internetmodel.h | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/internet/groovesharkservice.cpp b/src/internet/groovesharkservice.cpp index 43d933d0d..8f2bb6c77 100644 --- a/src/internet/groovesharkservice.cpp +++ b/src/internet/groovesharkservice.cpp @@ -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); diff --git a/src/internet/internetmodel.h b/src/internet/internetmodel.h index 3709819eb..496729228 100644 --- a/src/internet/internetmodel.h +++ b/src/internet/internetmodel.h @@ -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 {