mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 13:47:26 +02:00
Do not report the same tracks multiple times.
This commit is contained in:
@@ -149,7 +149,7 @@ AlbumPlaylistInterface::tracks() const
|
|||||||
|
|
||||||
Tomahawk::TracksRequest* cmd = m_collection->requestTracks( ap );
|
Tomahawk::TracksRequest* cmd = m_collection->requestTracks( ap );
|
||||||
connect( dynamic_cast< QObject* >( cmd ), SIGNAL( tracks( QList<Tomahawk::query_ptr> ) ),
|
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();
|
cmd->enqueue();
|
||||||
}
|
}
|
||||||
@@ -246,7 +246,7 @@ AlbumPlaylistInterface::infoSystemFinished( const QString& infoId )
|
|||||||
|
|
||||||
Tomahawk::TracksRequest* cmd = m_collection->requestTracks( ap );
|
Tomahawk::TracksRequest* cmd = m_collection->requestTracks( ap );
|
||||||
connect( dynamic_cast< QObject* >( cmd ), SIGNAL( tracks( QList<Tomahawk::query_ptr> ) ),
|
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();
|
cmd->enqueue();
|
||||||
}
|
}
|
||||||
@@ -262,6 +262,9 @@ AlbumPlaylistInterface::infoSystemFinished( const QString& infoId )
|
|||||||
void
|
void
|
||||||
AlbumPlaylistInterface::onTracksLoaded( const QList< query_ptr >& tracks )
|
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() )
|
if ( m_collection.isNull() )
|
||||||
{
|
{
|
||||||
m_databaseLoaded = true;
|
m_databaseLoaded = true;
|
||||||
|
@@ -73,6 +73,8 @@ ScriptCommand_AllTracks::reportFailure()
|
|||||||
{
|
{
|
||||||
emit tracks( QList< Tomahawk::query_ptr >() );
|
emit tracks( QList< Tomahawk::query_ptr >() );
|
||||||
emit done();
|
emit done();
|
||||||
|
disconnect();
|
||||||
|
sender()->disconnect( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -81,4 +83,7 @@ ScriptCommand_AllTracks::onResolverDone( const QList< Tomahawk::query_ptr >& q )
|
|||||||
{
|
{
|
||||||
emit tracks( q );
|
emit tracks( q );
|
||||||
emit done();
|
emit done();
|
||||||
|
disconnect();
|
||||||
|
sender()->disconnect( this );
|
||||||
|
//FIXME: find a way to delete this object when its job is done
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user