本文整理汇总了C++中source_ptr::isNull方法的典型用法代码示例。如果您正苦于以下问题:C++ source_ptr::isNull方法的具体用法?C++ source_ptr::isNull怎么用?C++ source_ptr::isNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类source_ptr
的用法示例。
在下文中一共展示了source_ptr::isNull方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: socialAttributesChanged
void
Source::reportSocialAttributesChanged( DatabaseCommand_SocialAction* action )
{
emit socialAttributesChanged();
if ( action->action() == "latchOn" )
{
const source_ptr to = SourceList::instance()->get( action->comment() );
if ( !to.isNull() )
emit latchedOn( to );
}
else if ( action->action() == "latchOff" )
{
const source_ptr from = SourceList::instance()->get( action->comment() );
if ( !from.isNull() )
emit latchedOff( from );
}
}
示例2: foreach
unsigned int
Artist::playbackCount( const source_ptr& source )
{
unsigned int count = 0;
foreach ( const PlaybackLog& log, m_playbackHistory )
{
if ( source.isNull() || log.source == source )
count++;
}
return count;
}
示例3: locker
unsigned int
TrackData::playbackCount( const source_ptr& source )
{
QMutexLocker locker( &s_memberMutex );
unsigned int count = 0;
foreach ( const PlaybackLog& log, m_playbackHistory )
{
if ( source.isNull() || log.source == source )
count++;
}
return count;
}
示例4: TrackModel
RecentlyAddedModel::RecentlyAddedModel( const source_ptr& source, QObject* parent )
: TrackModel( parent )
, m_source( source )
, m_limit( LATEST_TRACK_ITEMS )
{
if ( source.isNull() )
{
connect( SourceList::instance(), SIGNAL( ready() ), SLOT( onSourcesReady() ) );
connect( SourceList::instance(), SIGNAL( sourceAdded( Tomahawk::source_ptr ) ), SLOT( onSourceAdded( Tomahawk::source_ptr ) ) );
}
else
{
onSourceAdded( source );
loadHistory();
}
}
示例5: SourceTreeItem
bool
SourcesModel::appendItem( const source_ptr& source )
{
SourceTreeItem* item = new SourceTreeItem( source, this );
connect( item, SIGNAL( clicked( QModelIndex ) ), this, SIGNAL( clicked( QModelIndex ) ) );
// qDebug() << "Appending source item:" << item->source()->username();
invisibleRootItem()->appendRow( item->columns() );
if ( !source.isNull() )
{
connect( source.data(), SIGNAL( offline() ), SLOT( onSourceChanged() ) );
connect( source.data(), SIGNAL( online() ), SLOT( onSourceChanged() ) );
connect( source.data(), SIGNAL( stats( QVariantMap ) ), SLOT( onSourceChanged() ) );
connect( source.data(), SIGNAL( playbackStarted( Tomahawk::query_ptr ) ), SLOT( onSourceChanged() ) );
connect( source.data(), SIGNAL( stateChanged() ), SLOT( onSourceChanged() ) );
}
return true; // FIXME
}