1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-21 00:09:47 +01:00

Do not report the same tracks multiple times.

This commit is contained in:
Teo Mrnjavac 2013-02-04 14:21:37 +01:00
parent 6c5ad05d27
commit 05c04d046f
2 changed files with 10 additions and 2 deletions

View File

@ -149,7 +149,7 @@ AlbumPlaylistInterface::tracks() const
Tomahawk::TracksRequest* cmd = m_collection->requestTracks( ap );
connect( dynamic_cast< QObject* >( cmd ), SIGNAL( tracks( QList<Tomahawk::query_ptr> ) ),
this, SLOT( onTracksLoaded( QList<Tomahawk::query_ptr> ) ) );
this, SLOT( onTracksLoaded( QList<Tomahawk::query_ptr> ) ), Qt::UniqueConnection );
cmd->enqueue();
}
@ -246,7 +246,7 @@ AlbumPlaylistInterface::infoSystemFinished( const QString& infoId )
Tomahawk::TracksRequest* cmd = m_collection->requestTracks( ap );
connect( dynamic_cast< QObject* >( cmd ), SIGNAL( tracks( QList<Tomahawk::query_ptr> ) ),
this, SLOT( onTracksLoaded( QList<Tomahawk::query_ptr> ) ) );
this, SLOT( onTracksLoaded( QList<Tomahawk::query_ptr> ) ), Qt::UniqueConnection );
cmd->enqueue();
}
@ -262,6 +262,9 @@ AlbumPlaylistInterface::infoSystemFinished( const QString& infoId )
void
AlbumPlaylistInterface::onTracksLoaded( const QList< query_ptr >& tracks )
{
// disconnect( m_collection.data(), SIGNAL( tracksResult( QList< Tomahawk::query_ptr > ) ),
// this, SLOT( onTracksLoaded( QList< Tomahawk::query_ptr > ) ) );
if ( m_collection.isNull() )
{
m_databaseLoaded = true;

View File

@ -73,6 +73,8 @@ ScriptCommand_AllTracks::reportFailure()
{
emit tracks( QList< Tomahawk::query_ptr >() );
emit done();
disconnect();
sender()->disconnect( this );
}
@ -81,4 +83,7 @@ ScriptCommand_AllTracks::onResolverDone( const QList< Tomahawk::query_ptr >& q )
{
emit tracks( q );
emit done();
disconnect();
sender()->disconnect( this );
//FIXME: find a way to delete this object when its job is done
}