Skip to content
Permalink
Browse files

Drop QgsVectorLayer::pendingAllAttributesList()

Use QgsVectorLayer::allAttributes() instead.
  • Loading branch information
nyalldawson committed Jan 12, 2018
1 parent 068d51c commit 1da17904b86f0d517d6053a929daa25b0752f141
@@ -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}
@@ -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;
@@ -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()
@@ -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( "*" ) )
{
@@ -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()
@@ -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)

0 comments on commit 1da1790

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