mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-21 00:09:47 +01:00
Let ViewPages decide if they need a PageItem
This commit is contained in:
parent
479afff627
commit
fabbe65461
@ -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.
|
||||
|
@ -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(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user