Skip to content
Permalink
Browse files

[attrtable] Dismiss cached data when column is removed (Fix #8405)

  • Loading branch information
m-kuhn committed Aug 8, 2013
1 parent a2a4418 commit 16f24112f5dcc71ca2bab76f9bedc6bb7c5fc157
@@ -53,6 +53,7 @@ QgsAttributeTableModel::QgsAttributeTableModel( QgsVectorLayerCache *layerCache,
connect( layer(), SIGNAL( attributeValueChanged( QgsFeatureId, int, const QVariant& ) ), this, SLOT( attributeValueChanged( QgsFeatureId, int, const QVariant& ) ) );
connect( layer(), SIGNAL( featureAdded( QgsFeatureId ) ), this, SLOT( featureAdded( QgsFeatureId ) ) );
connect( layer(), SIGNAL( featureDeleted( QgsFeatureId ) ), this, SLOT( featureDeleted( QgsFeatureId ) ) );
connect( layer(), SIGNAL( attributeDeleted( int ) ), this, SLOT( attributeDeleted( int ) ) );
connect( layer(), SIGNAL( updatedFields() ), this, SLOT( updatedFields() ) );
connect( mLayerCache, SIGNAL( cachedLayerDeleted() ), this, SLOT( layerDeleted() ) );
}
@@ -148,6 +149,14 @@ void QgsAttributeTableModel::updatedFields()
emit modelChanged();
}

void QgsAttributeTableModel::attributeDeleted( int idx )
{
if ( idx == mCachedField )
{
prefetchColumnData( -1 );
}
}

void QgsAttributeTableModel::layerDeleted()
{
QgsDebugMsg( "entered." );
@@ -204,6 +204,11 @@ class GUI_EXPORT QgsAttributeTableModel: public QAbstractTableModel
*/
virtual void updatedFields();

/**
* Called whenever a column is removed;
*/
virtual void attributeDeleted( int idx );

protected slots:
/**
* Launched when attribute value has been changed

0 comments on commit 16f2411

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