1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-01 11:50:37 +02:00

Track collection page

This commit is contained in:
Uwe L. Korn
2014-11-16 16:24:16 +01:00
parent 945740eb21
commit 087b35cc89
2 changed files with 9 additions and 2 deletions

View File

@@ -33,6 +33,7 @@ CollectionItem::CollectionItem( SourcesModel* model, SourceTreeItem* parent, con
: SourceTreeItem( model, parent, SourcesModel::Collection )
, m_sortValue( -150 )
, m_collection( collection )
, m_page( nullptr )
{
m_text = tr( "Collection" );
m_icon = ImageRegistry::instance()->icon( RESPATH "images/collection.svg" );
@@ -81,6 +82,6 @@ CollectionItem::trackCount() const
void
CollectionItem::activate()
{
Tomahawk::ViewPage* page = ViewManager::instance()->show( m_collection );
model()->linkSourceItemToPage( this, page );
m_page = ViewManager::instance()->show( m_collection );
model()->linkSourceItemToPage( this, m_page );
}

View File

@@ -45,6 +45,12 @@ private:
QIcon m_icon;
QString m_text;
Tomahawk::collection_ptr m_collection;
/**
* Reference to the ViewPage for the collection. Until the page is loaded
* once on user request, this will be nullptr.
*/
Tomahawk::ViewPage* m_page;
};
#endif // COLLECTIONITEM_H