diff --git a/src/libtomahawk/ViewPage.h b/src/libtomahawk/ViewPage.h index 3c7609c53..2121a2208 100644 --- a/src/libtomahawk/ViewPage.h +++ b/src/libtomahawk/ViewPage.h @@ -72,6 +72,12 @@ public: virtual bool jumpToCurrentTrack() = 0; virtual bool isTemporaryPage() const { return false; } + + /** + * Should we add a row in the SourceTreeView for this page. + */ + virtual bool addPageItem() const { return true; } + /** * This page is actually a constant page that will be shown on every * restart of Tomahawk until the user selects it to be removed. diff --git a/src/tomahawk/sourcetree/SourcesModel.cpp b/src/tomahawk/sourcetree/SourcesModel.cpp index 475d06ad9..f64d7ba48 100644 --- a/src/tomahawk/sourcetree/SourcesModel.cpp +++ b/src/tomahawk/sourcetree/SourcesModel.cpp @@ -338,6 +338,11 @@ SourcesModel::appendGroups() void SourcesModel::appendPageItem( const QString& name, ViewPage* page, int sortValue ) { + // If there should be no page item, there is nothing to do for us here. + if ( !page->addPageItem() ) { + return; + } + QModelIndex parentIndex = indexFromItem( m_browse ); beginInsertRows( parentIndex, rowCount( parentIndex ), rowCount( parentIndex ) ); GenericPageItem* pageItem = new GenericPageItem( this, m_browse, page->title(), page->pixmap(),