Skip to content
Permalink
Browse files

Fix Coverity null pointer dereference warning

(cherry-picked from b22b62f)
  • Loading branch information
nyalldawson committed Apr 6, 2018
1 parent 071e58e commit 45d30a6b618899f21b63772ef40ad258ba1f5558
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/gui/attributetable/qgsattributetableview.cpp
@@ -109,7 +109,7 @@ void QgsAttributeTableView::setAttributeTableConfig( const QgsAttributeTableConf
void QgsAttributeTableView::setModel( QgsAttributeTableFilterModel *filterModel )
{
mFilterModel = filterModel;
QTableView::setModel( filterModel );
QTableView::setModel( mFilterModel );

if ( mFilterModel )
{
@@ -120,7 +120,7 @@ void QgsAttributeTableView::setModel( QgsAttributeTableFilterModel *filterModel
delete mFeatureSelectionModel;
mFeatureSelectionModel = nullptr;

if ( filterModel )
if ( mFilterModel )
{
if ( !mFeatureSelectionManager )
{
@@ -134,11 +134,11 @@ void QgsAttributeTableView::setModel( QgsAttributeTableFilterModel *filterModel
this, static_cast<void ( QgsAttributeTableView::* )( const QModelIndexList &indexes )>( &QgsAttributeTableView::repaintRequested ) );
connect( mFeatureSelectionModel, static_cast<void ( QgsFeatureSelectionModel::* )()>( &QgsFeatureSelectionModel::requestRepaint ),
this, static_cast<void ( QgsAttributeTableView::* )()>( &QgsAttributeTableView::repaintRequested ) );
}

connect( mFilterModel->layer(), &QgsVectorLayer::editingStarted, this, &QgsAttributeTableView::recreateActionWidgets );
connect( mFilterModel->layer(), &QgsVectorLayer::editingStopped, this, &QgsAttributeTableView::recreateActionWidgets );
connect( mFilterModel->layer(), &QgsVectorLayer::readOnlyChanged, this, &QgsAttributeTableView::recreateActionWidgets );
connect( mFilterModel->layer(), &QgsVectorLayer::editingStarted, this, &QgsAttributeTableView::recreateActionWidgets );
connect( mFilterModel->layer(), &QgsVectorLayer::editingStopped, this, &QgsAttributeTableView::recreateActionWidgets );
connect( mFilterModel->layer(), &QgsVectorLayer::readOnlyChanged, this, &QgsAttributeTableView::recreateActionWidgets );
}
}

void QgsAttributeTableView::setFeatureSelectionManager( QgsIFeatureSelectionManager *featureSelectionManager )

0 comments on commit 45d30a6

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