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


C++ Content::isValid方法代码示例

本文整理汇总了C++中attica::Content::isValid方法的典型用法代码示例。如果您正苦于以下问题:C++ Content::isValid方法的具体用法?C++ Content::isValid怎么用?C++ Content::isValid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在attica::Content的用法示例。


在下文中一共展示了Content::isValid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

void
LastFmAccount::authenticate()
{
    if ( !AtticaManager::instance()->resolversLoaded() )
    {
        // If we're still waiting to load, wait for the attica resolvers to come down the pipe
        connect( AtticaManager::instance(), SIGNAL(resolversLoaded(Attica::Content::List)), this, SLOT( atticaLoaded( Attica::Content::List ) ), Qt::UniqueConnection );
        return;
    }

    const Attica::Content res = AtticaManager::instance()->resolverForId( "lastfm" );
    const AtticaManager::ResolverState state = AtticaManager::instance()->resolverState( res );

    qDebug() << "Last.FM account authenticating...";
    if ( m_resolver.isNull() && state == AtticaManager::Installed )
    {
        hookupResolver();
    }
    else if ( m_resolver.isNull() )
    {
        qDebug() << "Got null resolver but asked to authenticate, so installing i we have one from attica:" << res.isValid() << res.id();
        if ( res.isValid() && !res.id().isEmpty() )
            AtticaManager::instance()->installResolver( res, false );
    }
    else
    {
        m_resolver.data()->start();
    }

    emit connectionStateChanged( connectionState() );
}
开发者ID:creichert,项目名称:tomahawk,代码行数:31,代码来源:LastFmAccount.cpp

示例2: info

void
SpotifyAccount::authenticate()
{
    if ( !AtticaManager::instance()->resolversLoaded() )
    {
        // If we're still waiting to load, wait for the attica resolvers to come down the pipe
        connect( AtticaManager::instance(), SIGNAL( resolversLoaded( Attica::Content::List ) ), this, SLOT( atticaLoaded( Attica::Content::List ) ), Qt::UniqueConnection );
        return;
    }

    const Attica::Content res = AtticaManager::instance()->resolverForId( s_resolverId );
    const AtticaManager::ResolverState state = AtticaManager::instance()->resolverState( res );

    qDebug() << "Spotify account authenticating...";

    const QString path = configuration().value( "path" ).toString();
    const QFileInfo info( path );
    const bool manualResolverRemoved = !path.isEmpty() && !info.exists();

    if ( m_spotifyResolver.isNull() && state == AtticaManager::Installed )
    {
        // We don;t have the resolver but it has been installed via attica already, so lets just turn it on
        qDebug() << "No valid spotify resolver running, but attica reports it is installed, so start it up";
        hookupResolver();
    }
    else if ( m_spotifyResolver.isNull() || manualResolverRemoved )
    {
        qDebug() << "Got null resolver but asked to authenticate, so installing if we have one from attica:" << res.isValid() << res.id();
        if ( res.isValid() && !res.id().isEmpty() )
            AtticaManager::instance()->installResolver( res, false );
        else
        {
#ifdef Q_OS_LINUX
            m_preventEnabling = true;
#endif
        }
    }
    else if ( !m_spotifyResolver.data()->running() )
    {
        qDebug() << "Spotify resolver exists but stopped, starting";
        m_spotifyResolver.data()->start();
    }
    else
    {
        qDebug() << "Spotify resolver exists and is running, ignore authentication attempt";
    }

    emit connectionStateChanged( connectionState() );
}
开发者ID:R4md4c,项目名称:tomahawk,代码行数:49,代码来源:SpotifyAccount.cpp


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