Skip to content
Permalink
Browse files

QgsAttributeTableView::setModel(): remove connection to signals that …

…no longer exist on QgsAttributeTableFilterModel, and connect destroyed() only if object is not NULL
  • Loading branch information
rouault committed Jun 12, 2016
1 parent 6b80170 commit 7861f89f6fc3509e733b6e7f9ff1be615ba2d5ac
Showing with 4 additions and 8 deletions.
  1. +4 −8 src/gui/attributetable/qgsattributetableview.cpp
@@ -115,17 +115,13 @@ void QgsAttributeTableView::setAttributeTableConfig( const QgsAttributeTableConf

void QgsAttributeTableView::setModel( QgsAttributeTableFilterModel* filterModel )
{
if ( mFilterModel )
{
// Cleanup old model stuff if present
disconnect( mFilterModel, SIGNAL( filterAboutToBeInvalidated() ), this, SLOT( onFilterAboutToBeInvalidated() ) );
disconnect( mFilterModel, SIGNAL( filterInvalidated() ), this, SLOT( onFilterInvalidated() ) );
}

mFilterModel = filterModel;
QTableView::setModel( filterModel );

connect( mFilterModel, SIGNAL( destroyed() ), this, SLOT( modelDeleted() ) );
if ( mFilterModel )
{
connect( mFilterModel, SIGNAL( destroyed() ), this, SLOT( modelDeleted() ) );
}

delete mFeatureSelectionModel;
mFeatureSelectionModel = nullptr;

0 comments on commit 7861f89

Please sign in to comment.
You can’t perform that action at this time.