当前位置: 首页>>代码示例>>C++>>正文


C++ collection_ptr::isNull方法代码示例

本文整理汇总了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;
    }
}
开发者ID:seezer,项目名称:tomahawk,代码行数:59,代码来源:Artist.cpp

示例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() );
    }
开发者ID:nelsont,项目名称:tomahawk,代码行数:35,代码来源:QtScriptResolver.cpp

示例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 );
    }
}
开发者ID:cash,项目名称:tomahawk,代码行数:12,代码来源:Result.cpp


注:本文中的tomahawk::collection_ptr::isNull方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。