mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 06:36:55 +02:00
* Updated Track- & TreeView to handle new interfaces.
This commit is contained in:
@@ -248,7 +248,6 @@ TrackView::autoPlayResolveFinished( const query_ptr& query, int row )
|
|||||||
const QModelIndex sib = index.sibling( index.row() + 1, index.column() );
|
const QModelIndex sib = index.sibling( index.row() + 1, index.column() );
|
||||||
if ( sib.isValid() )
|
if ( sib.isValid() )
|
||||||
startAutoPlay( sib );
|
startAutoPlay( sib );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -308,7 +307,6 @@ TrackView::tryToPlayItem( const QModelIndex& index )
|
|||||||
PlayableItem* item = m_model->itemFromIndex( m_proxyModel->mapToSource( index ) );
|
PlayableItem* item = m_model->itemFromIndex( m_proxyModel->mapToSource( index ) );
|
||||||
if ( item && !item->query().isNull() )
|
if ( item && !item->query().isNull() )
|
||||||
{
|
{
|
||||||
m_proxyModel->setCurrentIndex( index );
|
|
||||||
AudioEngine::instance()->playItem( playlistInterface(), item->query() );
|
AudioEngine::instance()->playItem( playlistInterface(), item->query() );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -719,19 +717,14 @@ TrackView::mousePressEvent( QMouseEvent* event )
|
|||||||
Tomahawk::playlistinterface_ptr
|
Tomahawk::playlistinterface_ptr
|
||||||
TrackView::playlistInterface() const
|
TrackView::playlistInterface() const
|
||||||
{
|
{
|
||||||
if ( m_playlistInterface.isNull() )
|
return proxyModel()->playlistInterface();
|
||||||
{
|
|
||||||
return proxyModel()->playlistInterface();
|
|
||||||
}
|
|
||||||
|
|
||||||
return m_playlistInterface;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TrackView::setPlaylistInterface( const Tomahawk::playlistinterface_ptr& playlistInterface )
|
TrackView::setPlaylistInterface( const Tomahawk::playlistinterface_ptr& playlistInterface )
|
||||||
{
|
{
|
||||||
m_playlistInterface = playlistInterface;
|
proxyModel()->setPlaylistInterface( playlistInterface );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -146,7 +146,6 @@ private:
|
|||||||
|
|
||||||
bool m_updateContextView;
|
bool m_updateContextView;
|
||||||
|
|
||||||
Tomahawk::playlistinterface_ptr m_playlistInterface;
|
|
||||||
QModelIndex m_hoveredIndex;
|
QModelIndex m_hoveredIndex;
|
||||||
QModelIndex m_contextMenuIndex;
|
QModelIndex m_contextMenuIndex;
|
||||||
|
|
||||||
|
@@ -232,12 +232,15 @@ TreeView::onItemActivated( const QModelIndex& index )
|
|||||||
if ( item )
|
if ( item )
|
||||||
{
|
{
|
||||||
if ( !item->artist().isNull() )
|
if ( !item->artist().isNull() )
|
||||||
|
{
|
||||||
ViewManager::instance()->show( item->artist() );
|
ViewManager::instance()->show( item->artist() );
|
||||||
|
}
|
||||||
else if ( !item->album().isNull() )
|
else if ( !item->album().isNull() )
|
||||||
|
{
|
||||||
ViewManager::instance()->show( item->album() );
|
ViewManager::instance()->show( item->album() );
|
||||||
|
}
|
||||||
else if ( !item->result().isNull() && item->result()->isOnline() )
|
else if ( !item->result().isNull() && item->result()->isOnline() )
|
||||||
{
|
{
|
||||||
m_model->setCurrentItem( item->index );
|
|
||||||
AudioEngine::instance()->playItem( m_proxyModel->playlistInterface(), item->result() );
|
AudioEngine::instance()->playItem( m_proxyModel->playlistInterface(), item->result() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user