1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 19:30:21 +02:00

Fixed TWK-1779: Duped script-collection tracks.

This commit is contained in:
Christian Muehlhaeuser
2014-11-09 04:29:17 +01:00
parent 7b8d3ad3db
commit e6d1e90542

View File

@@ -216,8 +216,7 @@ TreeModel::addTracks( const album_ptr& album, const QModelIndex& parent, bool au
connect( album.data(), SIGNAL( tracksAdded( QList<Tomahawk::query_ptr>, Tomahawk::ModelMode, Tomahawk::collection_ptr ) ), connect( album.data(), SIGNAL( tracksAdded( QList<Tomahawk::query_ptr>, Tomahawk::ModelMode, Tomahawk::collection_ptr ) ),
SLOT( onTracksFound( QList<Tomahawk::query_ptr>, Tomahawk::ModelMode, Tomahawk::collection_ptr ) ) ); SLOT( onTracksFound( QList<Tomahawk::query_ptr>, Tomahawk::ModelMode, Tomahawk::collection_ptr ) ) );
if ( !album->tracks( m_mode, m_collection ).isEmpty() ) onTracksAdded( album->tracks( m_mode, m_collection ), parent );
onTracksAdded( album->tracks( m_mode, m_collection ), parent );
} }
@@ -305,6 +304,8 @@ TreeModel::onTracksAdded( const QList<Tomahawk::query_ptr>& tracks, const QModel
QPair< int, int > crows; QPair< int, int > crows;
int c = rowCount( parent ); int c = rowCount( parent );
removeRows( 0, c, parent );
crows.first = c; crows.first = c;
crows.second = c + tracks.count() - 1; crows.second = c + tracks.count() - 1;