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

* Use PlayableModel's new currentIndex methods.

This commit is contained in:
Christian Muehlhaeuser 2012-12-23 08:13:23 +01:00
parent 96b9f38b2e
commit 93951bfdd4
2 changed files with 4 additions and 3 deletions

View File

@ -108,6 +108,7 @@ PlayableProxyModel::setSourcePlayableModel( PlayableModel* sourceModel )
disconnect( m_model, SIGNAL( loadingFinished() ), this, SIGNAL( loadingFinished() ) );
disconnect( m_model, SIGNAL( itemCountChanged( unsigned int ) ), this, SIGNAL( itemCountChanged( unsigned int ) ) );
disconnect( m_model, SIGNAL( indexPlayable( QModelIndex ) ), this, SLOT( onIndexPlayable( QModelIndex ) ) );
disconnect( m_model, SIGNAL( currentIndexChanged() ), this, SIGNAL( currentIndexChanged() ) );
}
m_model = sourceModel;
@ -118,6 +119,7 @@ PlayableProxyModel::setSourcePlayableModel( PlayableModel* sourceModel )
connect( m_model, SIGNAL( loadingFinished() ), SIGNAL( loadingFinished() ) );
connect( m_model, SIGNAL( itemCountChanged( unsigned int ) ), SIGNAL( itemCountChanged( unsigned int ) ) );
connect( m_model, SIGNAL( indexPlayable( QModelIndex ) ), SLOT( onIndexPlayable( QModelIndex ) ) );
connect( m_model, SIGNAL( currentIndexChanged() ), SIGNAL( currentIndexChanged() ) );
}
QSortFilterProxyModel::setSourceModel( m_model );
@ -632,8 +634,7 @@ void
PlayableProxyModel::setCurrentIndex( const QModelIndex& index )
{
tDebug() << Q_FUNC_INFO;
m_model->setCurrentItem( mapToSource( index ) );
emit currentIndexChanged();
m_model->setCurrentIndex( mapToSource( index ) );
}

View File

@ -270,7 +270,7 @@ PlaylistModel::insertEntries( const QList< Tomahawk::plentry_ptr >& entries, int
i++;
if ( entry->query()->id() == currentItemUuid() )
setCurrentItem( plitem->index );
setCurrentIndex( plitem->index );
if ( !entry->query()->resolvingFinished() && !entry->query()->playable() )
{