示例#1
0
Tomahawk::AlbumsRequest*
DatabaseCollection::requestAlbums( const Tomahawk::artist_ptr& artist )
{
    //FIXME: assuming there's only one dbcollection per source, and that this is the one
    Tomahawk::collection_ptr thisCollection = source()->dbCollection();
    if ( thisCollection->name() != this->name() )
        return 0;

    Tomahawk::AlbumsRequest* cmd = new DatabaseCommand_AllAlbums( thisCollection, artist );

    return cmd;
}
示例#2
0
Tomahawk::TracksRequest*
DatabaseCollection::requestTracks( const Tomahawk::album_ptr& album )
{
    //FIXME: assuming there's only one dbcollection per source, and that this is the one
    Tomahawk::collection_ptr thisCollection = source()->dbCollection();
    if ( thisCollection->name() != this->name() )
        return 0;

    DatabaseCommand_AllTracks* cmd = new DatabaseCommand_AllTracks( thisCollection );
    cmd->setAlbum( album->weakRef() );
    cmd->setSortOrder( DatabaseCommand_AllTracks::AlbumPosition );

    return cmd;
}