Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 7861f89
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/gui/attributetable/qgsattributetableview.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 7861f89

Please sign in to comment.