mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 05:37:29 +02:00
hide queue whenever it is emptied, manually or by play progressing
This commit is contained in:
@@ -29,6 +29,8 @@ QueueProxyModel::QueueProxyModel( QObject* parent )
|
|||||||
: PlaylistProxyModel( parent )
|
: PlaylistProxyModel( parent )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
|
||||||
|
connect( this, SIGNAL( sourceTrackCountChanged( unsigned int ) ), this, SLOT( onTrackCountChanged( unsigned int ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -46,10 +48,15 @@ QueueProxyModel::siblingItem( int itemsAway )
|
|||||||
Tomahawk::result_ptr res = PlaylistProxyModel::siblingItem( itemsAway );
|
Tomahawk::result_ptr res = PlaylistProxyModel::siblingItem( itemsAway );
|
||||||
|
|
||||||
qDebug() << "new rowcount:" << rowCount( QModelIndex() );
|
qDebug() << "new rowcount:" << rowCount( QModelIndex() );
|
||||||
if ( rowCount( QModelIndex() ) == 1 )
|
|
||||||
ViewManager::instance()->hideQueue();
|
|
||||||
|
|
||||||
removeIndex( currentItem() );
|
removeIndex( currentItem() );
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
QueueProxyModel::onTrackCountChanged( unsigned int count )
|
||||||
|
{
|
||||||
|
if ( count == 0 )
|
||||||
|
ViewManager::instance()->hideQueue();
|
||||||
|
}
|
||||||
|
@@ -34,6 +34,9 @@ public:
|
|||||||
~QueueProxyModel();
|
~QueueProxyModel();
|
||||||
|
|
||||||
virtual Tomahawk::result_ptr siblingItem( int itemsAway );
|
virtual Tomahawk::result_ptr siblingItem( int itemsAway );
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void onTrackCountChanged( unsigned int count );
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QUEUEPROXYMODEL_H
|
#endif // QUEUEPROXYMODEL_H
|
||||||
|
Reference in New Issue
Block a user