Ejemplo n.º 1
0
void
ScriptCommand_AllTracks::enqueue()
{
    Tomahawk::ScriptCollection* collection = qobject_cast< Tomahawk::ScriptCollection* >( m_collection.data() );
    if ( collection == 0 )
    {
        emit tracks( QList< Tomahawk::query_ptr >() );
        return;
    }

    collection->resolver()->enqueue( QSharedPointer< ScriptCommand >( this ) );
}
Ejemplo n.º 2
0
void
ScriptCommand_AllTracks::exec()
{
    Tomahawk::ScriptCollection* collection = qobject_cast< Tomahawk::ScriptCollection* >( m_collection.data() );
    if ( collection == 0 )
    {
        reportFailure();
        return;
    }

    if ( m_album.isNull() )
    {
        reportFailure();
        return;
    }

    connect( collection->resolver(), SIGNAL( tracksFound( QList< Tomahawk::query_ptr > ) ),
             this, SLOT( onResolverDone( QList< Tomahawk::query_ptr > ) ) );

    collection->resolver()->tracks( m_collection, m_album );
}
Ejemplo n.º 3
0
void
ScriptCommand_AllAlbums::exec()
{
    Tomahawk::ScriptCollection* collection = qobject_cast< Tomahawk::ScriptCollection* >( m_collection.data() );
    if ( collection == 0 )
    {
        reportFailure();
        return;
    }

    if ( !m_artist )
    {
        reportFailure();
        return;
    }

    connect( collection->resolver(), SIGNAL( albumsFound( QList< Tomahawk::album_ptr > ) ),
             this, SLOT( onResolverDone( QList< Tomahawk::album_ptr > ) ) );

    collection->resolver()->albums( m_collection, m_artist );
}