Пример #1
0
void
DynamicPlaylist::reportDeleted( const Tomahawk::dynplaylist_ptr& self )
{
//    qDebug() << Q_FUNC_INFO;
    Q_ASSERT( self.data() == this );
    // will emit Collection::playlistDeleted(...)
    if( self->mode() == Static )
        author()->collection()->deleteAutoPlaylist( self );
    else
        author()->collection()->deleteStation( self );

    emit deleted( self );
}
Пример #2
0
void
DynamicPlaylist::reportCreated( const Tomahawk::dynplaylist_ptr& self )
{
//    qDebug() << Q_FUNC_INFO;
    Q_ASSERT( self.data() == this );
    Q_ASSERT( !author().isNull() );
    Q_ASSERT( !author()->collection().isNull() );
    // will emit Collection::playlistCreated(...)
    //    qDebug() << "Creating dynplaylist belonging to:" << author().data() << author().isNull();
    //    qDebug() << "REPORTING DYNAMIC PLAYLIST CREATED:" << this << author()->friendlyName();
    if( self->mode() == Static )
        author()->collection()->addAutoPlaylist( self );
    else
        author()->collection()->addStation( self );
}
Пример #3
0
bool 
PlaylistManager::show( const Tomahawk::dynplaylist_ptr& playlist )
{
    if ( !m_dynamicWidgets.contains( playlist ) )
    {
       m_dynamicWidgets[ playlist ] = new Tomahawk::DynamicWidget( playlist, m_stack );

       playlist->resolve();
    }
    
    setPage( m_dynamicWidgets.value( playlist ) );

    if ( playlist->mode() == Tomahawk::OnDemand )
        m_queueView->hide();
    else
        m_queueView->show();
    
    TomahawkSettings::instance()->appendRecentlyPlayedPlaylist( playlist );
    emit numSourcesChanged( SourceList::instance()->count() );

    return true;
}