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:
parent
6c5ad05d27
commit
05c04d046f
@ -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;
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user