本文整理汇总了C++中attica::Content类的典型用法代码示例。如果您正苦于以下问题:C++ Content类的具体用法?C++ Content怎么用?C++ Content使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Content类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: resolverStateChanged
void
AtticaManager::uploadRating( const Content& c )
{
m_resolverStates[ c.id() ].userRating = c.rating();
for ( int i = 0; i < m_resolvers.count(); i++ )
{
if ( m_resolvers[ i ].id() == c.id() )
{
Attica::Content atticaContent = m_resolvers[ i ];
atticaContent.setRating( c.rating() );
m_resolvers[ i ] = atticaContent;
break;
}
}
TomahawkSettings::instance()->setAtticaResolverStates( m_resolverStates );
PostJob* job = m_resolverProvider.voteForContent( c.id(), (uint)c.rating() );
connect( job, SIGNAL( finished( Attica::BaseJob* ) ), job, SLOT( deleteLater() ) );
job->start();
emit resolverStateChanged( c.id() );
}
开发者ID:Pritoj,项目名称:tomahawk,代码行数:25,代码来源:AtticaManager.cpp
示例3:
// Sort binary resolvers above script resolvers, and script resolvers by download count
bool
resolverSort( const Attica::Content& first, const Attica::Content& second )
{
if ( !first.attribute( "typeid" ).isEmpty() && second.attribute( "typeid" ).isEmpty() )
return true;
return first.downloads() > second.downloads();
}
开发者ID:AltarBeastiful,项目名称:tomahawk,代码行数:9,代码来源:AtticaManager.cpp
示例4: startSocialService
void AddGameJob::startSocialService()
{
Attica::Category category;
category.setId( d->gameCategory );
Attica::Content content;
content.setName( d->gameName );
Attica::ItemPostJob<Attica::Content> *job = provider()->addNewContent( category, content );
connect( job, SIGNAL(finished(Attica::BaseJob*)), SLOT(addGameComplete(Attica::BaseJob*)) );
job->start();
}
开发者ID:KDE,项目名称:gluon,代码行数:12,代码来源:addgamejob.cpp
示例5: connect
void
LastFmAccount::hookupResolver()
{
// If there is a last.fm resolver from attica installed, create the corresponding ExternalResolver* and hook up to it
const Attica::Content res = AtticaManager::instance()->resolverForId( "lastfm" );
const AtticaManager::ResolverState state = AtticaManager::instance()->resolverState( res );
Q_ASSERT( state == AtticaManager::Installed );
Q_UNUSED( state );
const AtticaManager::Resolver data = AtticaManager::instance()->resolverData( res.id() );
m_resolver = QWeakPointer< ExternalResolverGui >( qobject_cast< ExternalResolverGui* >( Pipeline::instance()->addScriptResolver( data.scriptPath ) ) );
connect( m_resolver.data(), SIGNAL( changed() ), this, SLOT( resolverChanged() ) );
}
开发者ID:creichert,项目名称:tomahawk,代码行数:14,代码来源:LastFmAccount.cpp
示例6: 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
示例7: configuration
void
SpotifyAccount::hookupResolver()
{
// initialize the resolver itself. this is called if the account actually has an installed spotify resolver,
// as it might not.
// If there is a spotify resolver from attica installed, create the corresponding ExternalResolver* and hook up to it
QString path = configuration().value( "path" ).toString();
if ( path.isEmpty() )
{
const Attica::Content res = AtticaManager::instance()->resolverForId( s_resolverId );
const AtticaManager::ResolverState state = AtticaManager::instance()->resolverState( res );
Q_ASSERT( state == AtticaManager::Installed );
Q_UNUSED( state );
const AtticaManager::Resolver data = AtticaManager::instance()->resolverData( res.id() );
path = data.scriptPath;
}
qDebug() << "Starting spotify resolver with path:" << path;
m_spotifyResolver = QWeakPointer< ScriptResolver >( qobject_cast< ScriptResolver* >( Pipeline::instance()->addScriptResolver( path ) ) );
connect( m_spotifyResolver.data(), SIGNAL( changed() ), this, SLOT( resolverChanged() ) );
connect( m_spotifyResolver.data(), SIGNAL( customMessage( QString,QVariantMap ) ), this, SLOT( resolverMessage( QString, QVariantMap ) ) );
const bool hasMigrated = configuration().value( "hasMigrated" ).toBool();
if ( !hasMigrated )
{
qDebug() << "Getting credentials from spotify resolver to migrate to in-app config";
QVariantMap msg;
msg[ "_msgtype" ] = "getCredentials";
m_spotifyResolver.data()->sendMessage( msg );
}
}
开发者ID:creichert,项目名称:tomahawk,代码行数:34,代码来源:SpotifyAccount.cpp
示例8: configuration
void
SpotifyAccount::hookupResolver()
{
// initialize the resolver itself. this is called if the account actually has an installed spotify resolver,
// as it might not.
// If there is a spotify resolver from attica installed, create the corresponding ExternalResolver* and hook up to it
QString path = configuration().value( "path" ).toString();
if ( path.isEmpty() )
{
const Attica::Content res = AtticaManager::instance()->resolverForId( s_resolverId );
const AtticaManager::ResolverState state = AtticaManager::instance()->resolverState( res );
Q_ASSERT( state == AtticaManager::Installed );
Q_UNUSED( state );
const AtticaManager::Resolver data = AtticaManager::instance()->resolverData( res.id() );
path = data.scriptPath;
}
qDebug() << "Starting spotify resolver with path:" << path;
if ( !m_spotifyResolver.isNull() )
{
delete m_spotifyResolver.data();
}
if ( !QFile::exists( path ) )
{
qWarning() << "Asked to hook up spotify resolver but it doesn't exist, ignoring";
return;
}
// HACK
// Since the resolver in 0.4.x used an incompatible version of kdsingleappguard, we can't auto-kill old resolvers on the
// 0.4.x->0.5.x upgrade. So we do it manually for a while
killExistingResolvers();
m_spotifyResolver = QPointer< ScriptResolver >( qobject_cast< ScriptResolver* >( Pipeline::instance()->addScriptResolver( path ) ) );
m_spotifyResolver.data()->setIcon( TomahawkUtils::defaultPixmap( TomahawkUtils::SpotifyIcon ) );
connect( m_spotifyResolver.data(), SIGNAL( changed() ), this, SLOT( resolverChanged() ) );
connect( m_spotifyResolver.data(), SIGNAL( customMessage( QString,QVariantMap ) ), this, SLOT( resolverMessage( QString, QVariantMap ) ) );
// Always get logged in status
QVariantMap msg;
msg[ "_msgtype" ] = "getCredentials";
m_spotifyResolver.data()->sendMessage( msg );
}
开发者ID:R4md4c,项目名称:tomahawk,代码行数:45,代码来源:SpotifyAccount.cpp
示例9: processFetchedGameDetails
void GameDetailsJob::processFetchedGameDetails( Attica::BaseJob* job )
{
qDebug() << "Game list successfully fetched from the server!";
Attica::ItemJob<Attica::Content> *contentJob = static_cast<Attica::ItemJob<Attica::Content> *>( job );
if( contentJob->metadata().error() == Attica::Metadata::NoError )
{
Attica::Content content = contentJob->result();
d->gameDetails = new GameDetailItem( content.name(), content.description(), content.version(), content.summary(), content.previewPicture(),
content.attribute("typeid"), content.attribute("typename"), content.homePageEntry( 0 ).url().toString(),
content.license(), content.changelog(), "", "", QStringList(),
content.rating(), GameDetailItem::Downloadable, content.id() );
emitSucceeded();
}
else
{
emitFailed();
}
}
开发者ID:KDE,项目名称:gluon,代码行数:21,代码来源:gamedetailsjob.cpp
注:本文中的attica::Content类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论