Esempio n. 1
0
void
CollectionModel::removeCollection( const collection_ptr& collection )
{
    disconnect( collection.data(), SIGNAL( tracksAdded( QList<Tomahawk::query_ptr>, Tomahawk::collection_ptr ) ),
                this, SLOT( onTracksAdded( QList<Tomahawk::query_ptr>, Tomahawk::collection_ptr ) ) );
    disconnect( collection.data(), SIGNAL( tracksFinished( Tomahawk::collection_ptr ) ),
                this, SLOT( onTracksAddingFinished( Tomahawk::collection_ptr ) ) );

    QList<TrackModelItem*> plitems = m_collectionIndex.values( collection );

    m_collectionIndex.remove( collection );
}
Esempio n. 2
0
void
CollectionViewPage::loadCollection( const collection_ptr& collection )
{
    if ( m_collection )
    {
        disconnect( collection.data(), SIGNAL( changed() ), this, SLOT( onCollectionChanged() ) );
    }

    m_collection = collection;
    connect( collection.data(), SIGNAL( changed() ), SLOT( onCollectionChanged() ), Qt::UniqueConnection );

    onCollectionChanged();
}
Esempio n. 3
0
void
CollectionModel::addCollection( const collection_ptr& collection )
{
    qDebug() << Q_FUNC_INFO << collection->name()
                            << collection->source()->id()
                            << collection->source()->userName();

    emit loadingStarts();

    connect( collection.data(), SIGNAL( tracksAdded( QList<Tomahawk::query_ptr>, Tomahawk::collection_ptr ) ),
                                  SLOT( onTracksAdded( QList<Tomahawk::query_ptr>, Tomahawk::collection_ptr ) ) );
    connect( collection.data(), SIGNAL( tracksFinished( Tomahawk::collection_ptr ) ),
                                  SLOT( onTracksAddingFinished( Tomahawk::collection_ptr ) ) );
}