Skip to content

Commit

Permalink
Set feature valid on setId
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Mar 18, 2017
1 parent babab3d commit 616b4dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/core/qgsfeature.cpp
Expand Up @@ -128,6 +128,7 @@ void QgsFeature::setId( QgsFeatureId id )

d.detach();
d->fid = id;
d->valid = true;
}

QgsAttributes QgsFeature::attributes() const
Expand Down
5 changes: 2 additions & 3 deletions tests/src/python/test_qgsfeature.py
Expand Up @@ -63,9 +63,8 @@ def test_Validity(self):
self.assertTrue(f.isValid())
f.setValid(False)
self.assertFalse(f.isValid())

f.setValid(False)
self.assertFalse(f.isValid())
f.setId(27)
self.assertTrue(f.isValid())

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

0 comments on commit 616b4dd

Please sign in to comment.