1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 15:59:42 +01:00

Only connect slots if needed

This commit is contained in:
Uwe L. Korn 2014-07-16 07:04:47 +01:00
parent 8214e954db
commit 61e1638228

View File

@ -682,8 +682,18 @@ PlayableModel::insertInternal( const QList< T >& items, int row, const QList< To
plitem->index = createIndex( row + i, 0, plitem );
if ( plitem->query() )
{
connect( plitem->query().data(), SIGNAL( playableStateChanged( bool ) ), SLOT( onQueryBecamePlayable( bool ) ), Qt::UniqueConnection );
connect( plitem->query().data(), SIGNAL( resolvingFinished( bool ) ), SLOT( onQueryResolved( bool ) ), Qt::UniqueConnection );
if ( !plitem->query()->playable() )
{
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 )