本文整理汇总了C++中SourceTreeItem::currentlyLoadedPlaylistRevision方法的典型用法代码示例。如果您正苦于以下问题:C++ SourceTreeItem::currentlyLoadedPlaylistRevision方法的具体用法?C++ SourceTreeItem::currentlyLoadedPlaylistRevision怎么用?C++ SourceTreeItem::currentlyLoadedPlaylistRevision使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SourceTreeItem
的用法示例。
在下文中一共展示了SourceTreeItem::currentlyLoadedPlaylistRevision方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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 );
}
}
}
}