mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-04-21 16:31:58 +02:00
* Fixed queue auto-collapsing when playing the last track in it.
This commit is contained in:
parent
b39dbe6880
commit
fedb669041
@ -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();
|
||||
}
|
||||
|
@ -37,7 +37,6 @@ public:
|
||||
|
||||
private slots:
|
||||
void onIndexActivated( const QModelIndex& index );
|
||||
void onTrackCountChanged( unsigned int count );
|
||||
void onPlaybackStarted( const Tomahawk::result_ptr& result );
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user