本文整理汇总了C++中tomahawk::collection_ptr::isNull方法的典型用法代码示例。如果您正苦于以下问题:C++ collection_ptr::isNull方法的具体用法?C++ collection_ptr::isNull怎么用?C++ collection_ptr::isNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tomahawk::collection_ptr
的用法示例。
在下文中一共展示了collection_ptr::isNull方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: uuid
QList<album_ptr>
Artist::albums( ModelMode mode, const Tomahawk::collection_ptr& collection ) const
{
artist_ptr artist = m_ownRef.toStrongRef();
bool dbLoaded = m_albumsLoaded.value( DatabaseMode );
const bool infoLoaded = m_albumsLoaded.value( InfoSystemMode );
if ( !collection.isNull() )
dbLoaded = false;
m_uuid = uuid();
tDebug() << Q_FUNC_INFO << mode;
if ( ( mode == DatabaseMode || mode == Mixed ) && !dbLoaded )
{
DatabaseCommand_AllAlbums* cmd = new DatabaseCommand_AllAlbums( collection, artist );
cmd->setData( QVariant( collection.isNull() ) );
connect( cmd, SIGNAL( albums( QList<Tomahawk::album_ptr>, QVariant ) ),
SLOT( onAlbumsFound( QList<Tomahawk::album_ptr>, QVariant ) ) );
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>( cmd ) );
}
if ( ( mode == InfoSystemMode || mode == Mixed ) && !infoLoaded )
{
Tomahawk::InfoSystem::InfoStringHash artistInfo;
artistInfo["artist"] = name();
Tomahawk::InfoSystem::InfoRequestData requestData;
requestData.caller = m_uuid;
requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( artistInfo );
requestData.type = Tomahawk::InfoSystem::InfoArtistReleases;
connect( Tomahawk::InfoSystem::InfoSystem::instance(),
SIGNAL( info( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ),
SLOT( infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ), Qt::UniqueConnection );
connect( Tomahawk::InfoSystem::InfoSystem::instance(),
SIGNAL( finished( QString ) ),
SLOT( infoSystemFinished( QString ) ), Qt::UniqueConnection );
m_infoJobs++;
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData );
}
if ( !collection.isNull() )
return QList<album_ptr>();
switch ( mode )
{
case DatabaseMode:
return m_databaseAlbums;
case InfoSystemMode:
return m_officialAlbums;
default:
return m_databaseAlbums + m_officialAlbums;
}
}
示例2: qDebug
void
QtScriptResolverHelper::addAlbumTrackResults( const QVariantMap& results )
{
qDebug() << "Resolver reporting album tracks:" << results;
QString artistName = results.value( "artist" ).toString();
if ( artistName.trimmed().isEmpty() )
return;
QString albumName = results.value( "album" ).toString();
if ( albumName.trimmed().isEmpty() )
return;
Tomahawk::artist_ptr artist = Tomahawk::Artist::get( artistName, false );
Tomahawk::album_ptr album = Tomahawk::Album::get( artist, albumName, false );
QList< Tomahawk::result_ptr > tracks = m_resolver->parseResultVariantList( results.value("results").toList() );
QString qid = results.value("qid").toString();
Tomahawk::collection_ptr collection = Tomahawk::collection_ptr();
foreach ( const Tomahawk::collection_ptr& coll, m_resolver->collections() )
{
if ( coll->name() == qid )
{
collection = coll;
}
}
if ( collection.isNull() )
return;
QList< Tomahawk::query_ptr > queries;
foreach ( const Tomahawk::result_ptr& result, tracks )
{
result->setScore( 1.0 );
queries.append( result->toQuery() );
}
示例3: connect
void
Result::setResolvedByCollection( const Tomahawk::collection_ptr& collection , bool emitOnlineEvents )
{
m_collection = collection;
if ( emitOnlineEvents )
{
Q_ASSERT( !collection.isNull() );
connect( collection.data(), SIGNAL( destroyed( QObject * ) ), SLOT( onOffline() ), Qt::QueuedConnection );
connect( collection.data(), SIGNAL( online() ), SLOT( onOnline() ), Qt::QueuedConnection );
connect( collection.data(), SIGNAL( offline() ), SLOT( onOffline() ), Qt::QueuedConnection );
}
}