diff --git a/src/libtomahawk/playlist/PlayableModel.cpp b/src/libtomahawk/playlist/PlayableModel.cpp index 499a3707b..4ee447284 100644 --- a/src/libtomahawk/playlist/PlayableModel.cpp +++ b/src/libtomahawk/playlist/PlayableModel.cpp @@ -62,12 +62,6 @@ PlayableModel::~PlayableModel() QModelIndex PlayableModel::createIndex( int row, int column, PlayableItem* item ) const { - if ( item->query() ) - { - connect( item->query().data(), SIGNAL( playableStateChanged( bool ) ), SLOT( onQueryBecamePlayable( bool ) ), Qt::UniqueConnection ); - connect( item->query().data(), SIGNAL( resolvingFinished( bool ) ), SLOT( onQueryResolved( bool ) ), Qt::UniqueConnection ); - } - return QAbstractItemModel::createIndex( row, column, item ); } @@ -595,6 +589,11 @@ PlayableModel::insertInternal( const QList< T >& items, int row, const QList< To { plitem = new PlayableItem( item, m_rootItem, row + i ); plitem->index = createIndex( row + i, 0, plitem ); + if ( item->query() ) + { + connect( item->query().data(), SIGNAL( playableStateChanged( bool ) ), SLOT( onQueryBecamePlayable( bool ) ), Qt::UniqueConnection ); + connect( item->query().data(), SIGNAL( resolvingFinished( bool ) ), SLOT( onQueryResolved( bool ) ), Qt::UniqueConnection ); + } if ( logs.count() > i ) plitem->setPlaybackLog( logs.at( i ) );