1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 07:49:42 +01:00

* Fixed not advancing to next track within official releases tree-view.

This commit is contained in:
Christian Muehlhaeuser 2011-09-28 01:02:39 +02:00
parent 42d8476ea1
commit 17480fd887
3 changed files with 16 additions and 6 deletions

View File

@ -164,11 +164,6 @@ ArtistView::onItemActivated( const QModelIndex& index )
m_model->setCurrentItem( item->index );
AudioEngine::instance()->playItem( m_proxyModel, item->result() );
}
else if ( !item->query().isNull() && item->query()->results().count() )
{
m_model->setCurrentItem( item->index );
AudioEngine::instance()->playItem( m_proxyModel, item->query()->results().first() );
}
}
}
@ -337,6 +332,8 @@ ArtistView::onCustomContextMenu( const QPoint& pos )
if ( item && !item->result().isNull() )
queries << item->result()->toQuery();
else if ( item && !item->query().isNull() )
queries << item->query();
if ( item && !item->artist().isNull() )
artists << item->artist();
if ( item && !item->album().isNull() )

View File

@ -242,3 +242,16 @@ TreeModelItem::albumName() const
return QString();
}
const Tomahawk::result_ptr&
TreeModelItem::result() const
{
if ( m_result.isNull() && !m_query.isNull() )
{
if ( m_query->results().count() )
return m_query->results().first();
}
return m_result;
}

View File

@ -42,8 +42,8 @@ public:
const Tomahawk::artist_ptr& artist() const { return m_artist; };
const Tomahawk::album_ptr& album() const { return m_album; };
const Tomahawk::result_ptr& result() const { return m_result; };
const Tomahawk::query_ptr& query() const { return m_query; };
const Tomahawk::result_ptr& result() const;
bool isPlaying() { return m_isPlaying; }
void setIsPlaying( bool b ) { m_isPlaying = b; emit dataChanged(); }