Skip to content

Commit c0b8e9a

Browse files
committedNov 15, 2013
[attrtable] Minimize feature requests on load (Fix #8851)
1 parent eaf90e6 commit c0b8e9a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎src/gui/attributetable/qgsattributetablemodel.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,12 @@ bool QgsAttributeTableModel::removeRows( int row, int count, const QModelIndex &
133133
void QgsAttributeTableModel::featureAdded( QgsFeatureId fid )
134134
{
135135
QgsDebugMsgLevel( QString( "(%2) fid: %1" ).arg( fid ).arg( mFeatureRequest.filterType() ), 4 );
136-
if ( loadFeatureAtId( fid ) && mFeatureRequest.acceptFeature( mFeat ) )
136+
bool featOk = true;
137+
138+
if ( mFeat.id() != fid )
139+
featOk = loadFeatureAtId( fid );
140+
141+
if ( featOk && mFeatureRequest.acceptFeature( mFeat ) )
137142
{
138143
mFieldCache[ fid ] = mFeat.attribute( mCachedField );
139144

@@ -351,6 +356,7 @@ void QgsAttributeTableModel::loadLayer()
351356

352357
t.restart();
353358
}
359+
mFeat = feat;
354360
featureAdded( feat.id() );
355361
}
356362

0 commit comments

Comments
 (0)
Please sign in to comment.