本文整理汇总了C++中tomahawk::query_ptr::data方法的典型用法代码示例。如果您正苦于以下问题:C++ query_ptr::data方法的具体用法?C++ query_ptr::data怎么用?C++ query_ptr::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tomahawk::query_ptr
的用法示例。
在下文中一共展示了query_ptr::data方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: connect
void
TrackModelItem::setupItem( const Tomahawk::query_ptr& query, TrackModelItem* parent, int row )
{
this->parent = parent;
if ( parent )
{
if ( row < 0 )
{
parent->children.append( this );
row = parent->children.count() - 1;
}
else
{
parent->children.insert( row, this );
}
this->model = parent->model;
}
m_isPlaying = false;
toberemoved = false;
m_query = query;
if ( !query->numResults() )
{
connect( query.data(), SIGNAL( resultsAdded( QList<Tomahawk::result_ptr> ) ),
SIGNAL( dataChanged() ) );
connect( query.data(), SIGNAL( resultsRemoved( Tomahawk::result_ptr ) ),
SIGNAL( dataChanged() ) );
connect( query.data(), SIGNAL( resultsChanged() ),
SIGNAL( dataChanged() ) );
}
}
示例2: connect
void
DynamicModel::newTrackGenerated( const Tomahawk::query_ptr& query )
{
if ( m_onDemandRunning )
{
bool isDuplicate = false;
for ( int i = 0; i < m_deduper.size(); i++ )
{
if ( m_deduper[ i ].first == query->track() && m_deduper[ i ].second == query->artist() )
isDuplicate = true;
}
if ( isDuplicate )
{
m_playlist->generator()->fetchNext();
return;
}
else
{
m_deduper.append( QPair< QString, QString >( query->track(), query->artist() ) );
}
connect( query.data(), SIGNAL( resolvingFinished( bool ) ), this, SLOT( trackResolveFinished( bool ) ) );
m_waitingFor << query.data();
appendQuery( query );
}
}
示例3: QObject
TreeModelItem::TreeModelItem( const Tomahawk::query_ptr& query, TreeModelItem* parent, int row )
: QObject( parent )
, m_query( query )
{
this->parent = parent;
fetchingMore = false;
m_isPlaying = false;
if ( parent )
{
if ( row < 0 )
{
parent->children.append( this );
row = parent->children.count() - 1;
}
else
{
parent->children.insert( row, this );
}
this->model = parent->model;
}
toberemoved = false;
onResultsChanged();
connect( query.data(), SIGNAL( resultsAdded( QList<Tomahawk::result_ptr> ) ),
SLOT( onResultsChanged() ) );
connect( query.data(), SIGNAL( resultsRemoved( Tomahawk::result_ptr ) ),
SLOT( onResultsChanged() ) );
connect( query.data(), SIGNAL( resultsChanged() ),
SLOT( onResultsChanged() ) );
}
示例4: connect
void
DynamicModel::newTrackGenerated( const Tomahawk::query_ptr& query )
{
if( m_onDemandRunning ) {
connect( query.data(), SIGNAL( resolvingFinished( bool ) ), this, SLOT( trackResolveFinished( bool ) ) );
m_waitingFor << query.data();
append( query );
}
}
示例5: ErrorStatusMessage
void
AudioEngine::playItem( Tomahawk::playlistinterface_ptr playlist, const Tomahawk::query_ptr& query )
{
if ( query->resolvingFinished() )
{
if ( query->numResults() && query->results().first()->isOnline() )
{
playItem( playlist, query->results().first() );
return;
}
JobStatusView::instance()->model()->addJob(
new ErrorStatusMessage( tr( "Sorry, Tomahawk couldn't find the track '%1' by %2" ).arg( query->track() ).arg( query->artist() ), 15 ) );
if ( isStopped() )
emit stopped(); // we do this so the original caller knows we couldn't find this track
}
else
{
Pipeline::instance()->resolve( query );
NewClosure( query.data(), SIGNAL( resolvingFinished( bool ) ),
const_cast<AudioEngine*>(this), SLOT( playItem( Tomahawk::playlistinterface_ptr, Tomahawk::query_ptr ) ), playlist, query );
}
}
示例6: connect
void
PlaylistEntry::setQuery( const Tomahawk::query_ptr& q )
{
Q_D( PlaylistEntry );
d->query = q;
connect( q.data(), SIGNAL( resolvingFinished( bool ) ), SLOT( onQueryResolved( bool ) ) );
}
示例7: QObject
PlayableItem::PlayableItem( const Tomahawk::query_ptr& query, PlayableItem* parent, int row )
: QObject( parent )
, m_query( query )
{
init( parent, row );
connect( query->track().data(), SIGNAL( socialActionsLoaded() ),
SIGNAL( dataChanged() ) );
connect( query->track().data(), SIGNAL( updated() ),
SIGNAL( dataChanged() ) );
connect( query.data(), SIGNAL( resultsChanged() ),
SLOT( onResultsChanged() ) );
}
示例8: stream
void
SourceTreeView::dropEvent( QDropEvent* event )
{
bool accept = false;
const QPoint pos = event->pos();
const QModelIndex index = indexAt( pos );
if ( event->mimeData()->hasFormat( "application/tomahawk.query.list" ) )
{
const QPoint pos = event->pos();
const QModelIndex index = indexAt( pos );
if ( index.isValid() )
{
if ( SourcesModel::indexType( index ) == SourcesModel::PlaylistSource )
{
playlist_ptr playlist = SourcesModel::indexToPlaylist( index );
if ( !playlist.isNull() && playlist->author()->isLocal() )
{
accept = true;
QByteArray itemData = event->mimeData()->data( "application/tomahawk.query.list" );
QDataStream stream( &itemData, QIODevice::ReadOnly );
QList<Tomahawk::query_ptr> queries;
while ( !stream.atEnd() )
{
qlonglong qptr;
stream >> qptr;
Tomahawk::query_ptr* query = reinterpret_cast<Tomahawk::query_ptr*>(qptr);
if ( query && !query->isNull() )
{
qDebug() << "Dropped query item:" << query->data()->artist() << "-" << query->data()->track();
queries << *query;
}
}
qDebug() << "on playlist:" << playlist->title() << playlist->guid();
SourceTreeItem* treeItem = SourcesModel::indexToTreeItem( index );
if ( treeItem )
{
QString rev = treeItem->currentlyLoadedPlaylistRevision( playlist->guid() );
playlist->addEntries( queries, rev );
}
}
}
}
示例9: textChanged
void
QueryLabel::setQuery( const Tomahawk::query_ptr& query )
{
if ( query.isNull() )
return;
setContentsMargins( BOXMARGIN * 2, BOXMARGIN / 2, BOXMARGIN * 2, BOXMARGIN / 2 );
if ( m_query.isNull() || m_query.data() != query.data() )
{
m_query = query;
m_result.clear();
updateLabel();
emit textChanged( text() );
emit queryChanged( m_query );
}
}