Skip to content

Commit

Permalink
Drop QgsVectorLayer::pendingAllAttributesList()
Browse files Browse the repository at this point in the history
Use QgsVectorLayer::allAttributes() instead.
  • Loading branch information
nyalldawson committed Jan 15, 2018
1 parent 068d51c commit 1da1790
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 15 deletions.
1 change: 1 addition & 0 deletions doc/api_break.dox
Expand Up @@ -2432,6 +2432,7 @@ displayExpression instead. For the map tip use mapTipTemplate() instead.
- splitParts() now returns QgsGeometry::OperationResult enum, integer representation of returned values may have changed
- splitFeatured() now returns QgsGeometry::OperationResult enum, integer representation of returned values may have changed
- pendingFields() was dropped. Use fields() instead.
- pendingAllAttributesList() was dropped. Use allAttributes() instead.


QgsVectorLayerEditBuffer {#qgis_api_break_3_0_QgsVectorLayerEditBuffer}
Expand Down
6 changes: 0 additions & 6 deletions python/core/qgsvectorlayer.sip
Expand Up @@ -1392,12 +1392,6 @@ Returns the list of fields of this layer.
This also includes fields which have not yet been saved to the provider.

:return: A list of fields
%End

QgsAttributeList pendingAllAttributesList() const;
%Docstring
Returns list of attribute indexes. i.e. a list from 0 ... fieldCount()
Alias for attributeList()
%End

QgsAttributeList attributeList() const;
Expand Down
6 changes: 0 additions & 6 deletions src/core/qgsvectorlayer.h
Expand Up @@ -1302,12 +1302,6 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
*/
inline QgsFields fields() const override { return mFields; }

/**
* Returns list of attribute indexes. i.e. a list from 0 ... fieldCount()
* Alias for attributeList()
*/
inline QgsAttributeList pendingAllAttributesList() const { return mFields.allAttributesList(); }

/**
* Returns list of attribute indexes. i.e. a list from 0 ... fieldCount()
* Alias for attributeList()
Expand Down
2 changes: 1 addition & 1 deletion src/server/services/wfs/qgswfsgetfeature.cpp
Expand Up @@ -240,7 +240,7 @@ namespace QgsWfs
QStringList propertyList = query.propertyList;

//Using pending attributes and pending fields
QgsAttributeList attrIndexes = vlayer->pendingAllAttributesList();
QgsAttributeList attrIndexes = vlayer->attributeList();
bool withGeom = true;
if ( !propertyList.isEmpty() && propertyList.first() != QStringLiteral( "*" ) )
{
Expand Down
4 changes: 2 additions & 2 deletions tests/src/python/test_qgsvectorlayer.py
Expand Up @@ -937,7 +937,7 @@ def checkAfterOneDelete():
self.assertEqual(len(flds), 2)
self.assertEqual(flds[0].name(), "fldint")
self.assertEqual(flds[1].name(), "flddouble")
self.assertEqual(layer.pendingAllAttributesList(), [0, 1])
self.assertEqual(layer.attributeList(), [0, 1])

f = next(layer.getFeatures())
attrs = f.attributes()
Expand All @@ -951,7 +951,7 @@ def checkAfterOneDelete():
self.assertTrue(layer.deleteAttribute(0))

def checkAfterTwoDeletes():
self.assertEqual(layer.pendingAllAttributesList(), [0])
self.assertEqual(layer.attributeList(), [0])
flds = layer.fields()
# for fld in flds: print "FLD", fld.name()
self.assertEqual(len(flds), 1)
Expand Down

0 comments on commit 1da1790

Please sign in to comment.