本文整理汇总了C++中PlayableItem::albumName方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayableItem::albumName方法的具体用法?C++ PlayableItem::albumName怎么用?C++ PlayableItem::albumName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayableItem
的用法示例。
在下文中一共展示了PlayableItem::albumName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
bool
TreeProxyModel::filterAcceptsRow( int sourceRow, const QModelIndex& sourceParent ) const
{
PlayableItem* item = sourceModel()->itemFromIndex( sourceModel()->index( sourceRow, 0, sourceParent ) );
Q_ASSERT( item );
//FIXME: m_cache lookup is broken
if ( /*m_model->mode() == Tomahawk::DatabaseMode &&*/ !item->query().isNull() )
{
/* QList< Tomahawk::query_ptr > rl = m_cache.values( sourceParent );
foreach ( const Tomahawk::query_ptr& cachedQuery, rl )
{
if ( cachedQuery.isNull() )
continue;
if ( cachedQuery->track()->track() == item->query()->track()->track() &&
( cachedQuery->track()->albumpos() == item->query()->track()->albumpos() || cachedQuery->track()->albumpos() == 0 ) )
{
return ( cachedQuery.data() == item->query().data() );
}
}*/
for ( int i = 0; i < sourceModel()->rowCount( sourceParent ); i++ )
{
if ( i == sourceRow )
continue;
PlayableItem* ti = sourceModel()->itemFromIndex( sourceModel()->index( i, 0, sourceParent ) );
if ( ti && ti->name() == item->name() && !ti->query().isNull() )
{
if ( ti->query()->track()->albumpos() == item->query()->track()->albumpos() || ti->query()->track()->albumpos() == 0 || item->query()->track()->albumpos() == 0 )
{
if ( item->result().isNull() )
return false;
if ( !ti->result().isNull() )
{
if ( !item->result()->isOnline() && ti->result()->isOnline() )
return false;
if ( ( item->result()->resolvedByCollection().isNull() || !item->result()->resolvedByCollection()->isLocal() ) &&
!ti->result()->resolvedByCollection().isNull() && ti->result()->resolvedByCollection()->isLocal() )
{
return false;
}
}
}
}
}
}
bool accepted = false;
if ( m_filter.isEmpty() )
accepted = true;
else if ( !item->artist().isNull() )
accepted = m_artistsFilter.contains( item->artist() );
else if ( !item->album().isNull() )
accepted = m_albumsFilter.contains( item->album() );
if ( !accepted )
{
QStringList sl = m_filter.split( " ", QString::SkipEmptyParts );
foreach( const QString& s, sl )
{
if ( !item->name().contains( s, Qt::CaseInsensitive ) &&
!item->albumName().contains( s, Qt::CaseInsensitive ) &&
!item->artistName().contains( s, Qt::CaseInsensitive ) )
{
return false;
}
}
}