diff --git a/src/libtomahawk/playlist/QueueProxyModel.cpp b/src/libtomahawk/playlist/QueueProxyModel.cpp index 78a0f7cb0..c2023642a 100644 --- a/src/libtomahawk/playlist/QueueProxyModel.cpp +++ b/src/libtomahawk/playlist/QueueProxyModel.cpp @@ -33,7 +33,6 @@ QueueProxyModel::QueueProxyModel( TrackView* parent ) : PlayableProxyModel( parent ) { connect( parent, SIGNAL( itemActivated( QModelIndex ) ), SLOT( onIndexActivated( QModelIndex ) ) ); - connect( playlistInterface().data(), SIGNAL( sourceTrackCountChanged( unsigned int ) ), SLOT( onTrackCountChanged( unsigned int ) ) ); connect( AudioEngine::instance(), SIGNAL( loading( Tomahawk::result_ptr ) ), SLOT( onPlaybackStarted( Tomahawk::result_ptr ) ) ); } @@ -52,7 +51,11 @@ QueueProxyModel::onPlaybackStarted( const Tomahawk::result_ptr& result ) PlayableItem* item = itemFromIndex( mapToSource( idx ) ); if ( item && item->query() && ( item->query()->results().contains( result ) || item->query()->equals( result->toQuery() ) ) ) + { removeIndex( idx ); + if ( !rowCount() ) + ViewManager::instance()->hideQueue(); + } } } @@ -62,12 +65,7 @@ QueueProxyModel::onIndexActivated( const QModelIndex& index ) { setCurrentIndex( QModelIndex() ); removeIndex( index ); -} - -void -QueueProxyModel::onTrackCountChanged( unsigned int count ) -{ - if ( count == 0 ) + if ( !rowCount() ) ViewManager::instance()->hideQueue(); } diff --git a/src/libtomahawk/playlist/QueueProxyModel.h b/src/libtomahawk/playlist/QueueProxyModel.h index 3c39a68dc..f2755a03a 100644 --- a/src/libtomahawk/playlist/QueueProxyModel.h +++ b/src/libtomahawk/playlist/QueueProxyModel.h @@ -37,7 +37,6 @@ public: private slots: void onIndexActivated( const QModelIndex& index ); - void onTrackCountChanged( unsigned int count ); void onPlaybackStarted( const Tomahawk::result_ptr& result ); };