Skip to content

Commit 616b4dd

Browse files
committedMar 18, 2017
Set feature valid on setId
1 parent babab3d commit 616b4dd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎src/core/qgsfeature.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ void QgsFeature::setId( QgsFeatureId id )
128128

129129
d.detach();
130130
d->fid = id;
131+
d->valid = true;
131132
}
132133

133134
QgsAttributes QgsFeature::attributes() const

‎tests/src/python/test_qgsfeature.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,8 @@ def test_Validity(self):
6363
self.assertTrue(f.isValid())
6464
f.setValid(False)
6565
self.assertFalse(f.isValid())
66-
67-
f.setValid(False)
68-
self.assertFalse(f.isValid())
66+
f.setId(27)
67+
self.assertTrue(f.isValid())
6968

7069
def test_Attributes(self):
7170
myPath = os.path.join(unitTestDataPath(), 'lines.shp')

0 commit comments

Comments
 (0)
Please sign in to comment.