1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-16 19:14:06 +02:00

* CreateIndex isn't the right place to connect signals.

This commit is contained in:
Christian Muehlhaeuser
2013-05-26 21:38:46 +02:00
parent 6264813d5c
commit dcaa6ef8d7

View File

@@ -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 );
}
@@ -608,6 +602,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 ) );