mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
Only connect slots if needed
This commit is contained in:
@@ -682,8 +682,18 @@ PlayableModel::insertInternal( const QList< T >& items, int row, const QList< To
|
|||||||
plitem->index = createIndex( row + i, 0, plitem );
|
plitem->index = createIndex( row + i, 0, plitem );
|
||||||
if ( plitem->query() )
|
if ( plitem->query() )
|
||||||
{
|
{
|
||||||
connect( plitem->query().data(), SIGNAL( playableStateChanged( bool ) ), SLOT( onQueryBecamePlayable( bool ) ), Qt::UniqueConnection );
|
if ( !plitem->query()->playable() )
|
||||||
connect( plitem->query().data(), SIGNAL( resolvingFinished( bool ) ), SLOT( onQueryResolved( bool ) ), Qt::UniqueConnection );
|
{
|
||||||
|
connect( plitem->query().data(), SIGNAL( playableStateChanged( bool ) ),
|
||||||
|
SLOT( onQueryBecamePlayable( bool ) ),
|
||||||
|
Qt::UniqueConnection );
|
||||||
|
}
|
||||||
|
if ( !plitem->query()->resolvingFinished() )
|
||||||
|
{
|
||||||
|
connect( plitem->query().data(), SIGNAL( resolvingFinished( bool ) ),
|
||||||
|
SLOT( onQueryResolved( bool ) ),
|
||||||
|
Qt::UniqueConnection );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( logs.count() > i )
|
if ( logs.count() > i )
|
||||||
|
Reference in New Issue
Block a user