1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-25 02:09:48 +01:00

* OverlayWidget needs to update when items get removed, too.

This commit is contained in:
Christian Muehlhaeuser 2012-06-01 07:09:44 +02:00
parent 3a47a5f9c8
commit d713dec19d

View File

@ -47,6 +47,7 @@ OverlayWidget::OverlayWidget( QAbstractItemView* parent )
if ( m_parent->model() )
{
connect( m_parent->model(), SIGNAL( rowsInserted( QModelIndex, int, int ) ), SLOT( onViewChanged() ), Qt::UniqueConnection );
connect( m_parent->model(), SIGNAL( rowsRemoved( QModelIndex, int, int ) ), SLOT( onViewChanged() ), Qt::UniqueConnection );
}
connect( m_parent, SIGNAL( modelChanged() ), SLOT( onViewModelChanged() ) );
@ -131,6 +132,7 @@ void
OverlayWidget::onViewChanged()
{
PlayableProxyModel* model = qobject_cast<PlayableProxyModel*>( m_parent->model() );
if ( m_text.isEmpty() || ( model && ( model->rowCount( QModelIndex() ) || model->isLoading() ) ) )
{
hide();