コード例 #1
0
void
CollectionViewPage::onCollectionChanged()
{
    TreeModel* model = new TreeModel();
    PlayableModel* flatModel = new PlayableModel();
    PlayableModel* albumModel = new PlayableModel();

    setTreeModel( model );
    setFlatModel( flatModel );
    setAlbumModel( albumModel );

    model->addCollection( m_collection );
    flatModel->appendTracks( m_collection );
    albumModel->appendAlbums( m_collection );

    if ( m_collection && m_collection->source() && m_collection->source()->isLocal() )
    {
        setEmptyTip( tr( "After you have scanned your music collection you will find your tracks right here." ) );
    }
    else
        setEmptyTip( tr( "This collection is empty." ) );

    if ( m_collection.objectCast<ScriptCollection>() )
        m_trackView->setEmptyTip( tr( "Cloud collections aren't supported in the flat view yet. We will have them covered soon. Switch to another view to navigate them." ) );
}
コード例 #2
0
void
CollectionViewPage::onCollectionChanged()
{
    TreeModel* model = new TreeModel();
    PlayableModel* flatModel = new PlayableModel();
    PlayableModel* albumModel = new PlayableModel();

    setTreeModel( model );
    setFlatModel( flatModel );
    setAlbumModel( albumModel );

    model->addCollection( m_collection );
    flatModel->appendTracks( m_collection );
    albumModel->appendAlbums( m_collection );

    if ( m_collection && m_collection->isLocal() )
    {
        setEmptyTip( tr( "After you have scanned your music collection you will find your tracks right here." ) );
    }
    else
        setEmptyTip( tr( "This collection is empty." ) );
}