mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 23:57:34 +02:00
* Use PlayableModel's new currentIndex methods.
This commit is contained in:
@@ -108,6 +108,7 @@ PlayableProxyModel::setSourcePlayableModel( PlayableModel* sourceModel )
|
|||||||
disconnect( m_model, SIGNAL( loadingFinished() ), this, SIGNAL( loadingFinished() ) );
|
disconnect( m_model, SIGNAL( loadingFinished() ), this, SIGNAL( loadingFinished() ) );
|
||||||
disconnect( m_model, SIGNAL( itemCountChanged( unsigned int ) ), this, SIGNAL( itemCountChanged( unsigned int ) ) );
|
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( indexPlayable( QModelIndex ) ), this, SLOT( onIndexPlayable( QModelIndex ) ) );
|
||||||
|
disconnect( m_model, SIGNAL( currentIndexChanged() ), this, SIGNAL( currentIndexChanged() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_model = sourceModel;
|
m_model = sourceModel;
|
||||||
@@ -118,6 +119,7 @@ PlayableProxyModel::setSourcePlayableModel( PlayableModel* sourceModel )
|
|||||||
connect( m_model, SIGNAL( loadingFinished() ), SIGNAL( loadingFinished() ) );
|
connect( m_model, SIGNAL( loadingFinished() ), SIGNAL( loadingFinished() ) );
|
||||||
connect( m_model, SIGNAL( itemCountChanged( unsigned int ) ), SIGNAL( itemCountChanged( unsigned int ) ) );
|
connect( m_model, SIGNAL( itemCountChanged( unsigned int ) ), SIGNAL( itemCountChanged( unsigned int ) ) );
|
||||||
connect( m_model, SIGNAL( indexPlayable( QModelIndex ) ), SLOT( onIndexPlayable( QModelIndex ) ) );
|
connect( m_model, SIGNAL( indexPlayable( QModelIndex ) ), SLOT( onIndexPlayable( QModelIndex ) ) );
|
||||||
|
connect( m_model, SIGNAL( currentIndexChanged() ), SIGNAL( currentIndexChanged() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
QSortFilterProxyModel::setSourceModel( m_model );
|
QSortFilterProxyModel::setSourceModel( m_model );
|
||||||
@@ -632,8 +634,7 @@ void
|
|||||||
PlayableProxyModel::setCurrentIndex( const QModelIndex& index )
|
PlayableProxyModel::setCurrentIndex( const QModelIndex& index )
|
||||||
{
|
{
|
||||||
tDebug() << Q_FUNC_INFO;
|
tDebug() << Q_FUNC_INFO;
|
||||||
m_model->setCurrentItem( mapToSource( index ) );
|
m_model->setCurrentIndex( mapToSource( index ) );
|
||||||
emit currentIndexChanged();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -270,7 +270,7 @@ PlaylistModel::insertEntries( const QList< Tomahawk::plentry_ptr >& entries, int
|
|||||||
i++;
|
i++;
|
||||||
|
|
||||||
if ( entry->query()->id() == currentItemUuid() )
|
if ( entry->query()->id() == currentItemUuid() )
|
||||||
setCurrentItem( plitem->index );
|
setCurrentIndex( plitem->index );
|
||||||
|
|
||||||
if ( !entry->query()->resolvingFinished() && !entry->query()->playable() )
|
if ( !entry->query()->resolvingFinished() && !entry->query()->playable() )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user