mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-24 09:49:42 +01:00
* CreateIndex isn't the right place to connect signals.
This commit is contained in:
parent
2e6ae760a1
commit
56632f10bd
@ -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 ) );
|
||||
|
Loading…
x
Reference in New Issue
Block a user