1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 07:49:42 +01:00

* Fixed how GridView hooks up its layout-related signals.

This commit is contained in:
Christian Muehlhaeuser 2012-12-20 11:26:13 +01:00
parent 9670112dd9
commit b62f54ade0

View File

@ -19,7 +19,6 @@
#include "GridView.h"
#include <QHeaderView>
#include <QKeyEvent>
#include <QPainter>
#include <QScrollBar>
@ -99,10 +98,14 @@ GridView::setProxyModel( PlayableProxyModel* model )
if ( m_proxyModel )
{
disconnect( m_proxyModel, SIGNAL( filterChanged( QString ) ), this, SLOT( onFilterChanged( QString ) ) );
disconnect( m_proxyModel, SIGNAL( rowsInserted( QModelIndex, int, int ) ), this, SLOT( verifySize() ) );
disconnect( m_proxyModel, SIGNAL( rowsRemoved( QModelIndex, int, int ) ), this, SLOT( verifySize() ) );
}
m_proxyModel = model;
connect( m_proxyModel, SIGNAL( filterChanged( QString ) ), SLOT( onFilterChanged( QString ) ) );
connect( m_proxyModel, SIGNAL( rowsInserted( QModelIndex, int, int ) ), SLOT( verifySize() ) );
connect( m_proxyModel, SIGNAL( rowsRemoved( QModelIndex, int, int ) ), SLOT( verifySize() ) );
if ( m_delegate )
delete m_delegate;
@ -131,8 +134,6 @@ GridView::setPlayableModel( PlayableModel* model )
{
if ( m_model )
{
disconnect( model, SIGNAL( rowsInserted( QModelIndex, int, int ) ), this, SLOT( verifySize() ) );
disconnect( model, SIGNAL( rowsRemoved( QModelIndex, int, int ) ), this, SLOT( verifySize() ) );
}
m_inited = false;
@ -144,9 +145,6 @@ GridView::setPlayableModel( PlayableModel* model )
m_proxyModel->sort( 0 );
}
connect( model, SIGNAL( rowsInserted( QModelIndex, int, int ) ), SLOT( verifySize() ) );
connect( model, SIGNAL( rowsRemoved( QModelIndex, int, int ) ), SLOT( verifySize() ) );
emit modelChanged();
}