Skip to content

Commit

Permalink
Don't force use of In,Out in QgsFeatureSink methods
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 26, 2017
1 parent 49d4b5e commit 1280779
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions python/core/qgsfeaturesink.sip
Expand Up @@ -24,15 +24,15 @@ class QgsFeatureSink

virtual ~QgsFeatureSink();

virtual bool addFeature( QgsFeature &feature /In,Out/ ) = 0;
virtual bool addFeature( QgsFeature &feature ) = 0;
%Docstring
Adds a single ``feature`` to the sink.
\see addFeatures()
:return: true in case of success and false in case of failure
:rtype: bool
%End

virtual bool addFeatures( QgsFeatureList &features /In,Out/ ) = 0;
virtual bool addFeatures( QgsFeatureList &features ) = 0;
%Docstring
Adds a list of ``features`` to the sink.
\see addFeature()
Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsfeaturestore.sip
Expand Up @@ -53,9 +53,9 @@ Constructor
\see crs()
%End

virtual bool addFeature( QgsFeature &feature /In,Out/ );
virtual bool addFeature( QgsFeature &feature );

virtual bool addFeatures( QgsFeatureList &features /In,Out/ );
virtual bool addFeatures( QgsFeatureList &features );


QgsFeatureList features() const;
Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsvectorfilewriter.sip
Expand Up @@ -380,8 +380,8 @@ class QgsVectorFileWriter : QgsFeatureSink
/** Retrieves error message */
QString errorMessage();

bool addFeature( QgsFeature &feature /In,Out/ );
bool addFeatures( QgsFeatureList &features /In,Out/ );
bool addFeature( QgsFeature &feature );
bool addFeatures( QgsFeatureList &features );

/** Add feature to the currently opened data source */
bool addFeature( QgsFeature& feature, QgsFeatureRenderer* renderer, QgsUnitTypes::DistanceUnit outputUnit = QgsUnitTypes::DistanceMeters );
Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsvectorlayer.sip
Expand Up @@ -901,7 +901,7 @@ Return the provider type for this layer
:rtype: QgsFeatureIterator
%End

virtual bool addFeature( QgsFeature &feature /In,Out/ );
virtual bool addFeature( QgsFeature &feature );

%Docstring
Adds a single ``feature`` to the layer.
Expand Down Expand Up @@ -1260,7 +1260,7 @@ Delete an attribute field (but does not commit it)
:rtype: bool
%End

virtual bool addFeatures( QgsFeatureList &features /In,Out/ );
virtual bool addFeatures( QgsFeatureList &features );


bool deleteFeature( QgsFeatureId fid );
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsfeaturesink.h
Expand Up @@ -40,14 +40,14 @@ class CORE_EXPORT QgsFeatureSink
* \see addFeatures()
* \returns true in case of success and false in case of failure
*/
virtual bool addFeature( QgsFeature &feature SIP_INOUT ) = 0;
virtual bool addFeature( QgsFeature &feature ) = 0;

/**
* Adds a list of \a features to the sink.
* \see addFeature()
* \returns true in case of success and false in case of failure
*/
virtual bool addFeatures( QgsFeatureList &features SIP_INOUT ) = 0;
virtual bool addFeatures( QgsFeatureList &features ) = 0;

};

Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsfeaturestore.h
Expand Up @@ -61,8 +61,8 @@ class CORE_EXPORT QgsFeatureStore : public QgsFeatureSink
*/
void setCrs( const QgsCoordinateReferenceSystem &crs ) { mCrs = crs; }

bool addFeature( QgsFeature &feature SIP_INOUT ) override;
bool addFeatures( QgsFeatureList &features SIP_INOUT ) override;
bool addFeature( QgsFeature &feature ) override;
bool addFeatures( QgsFeatureList &features ) override;

/**
* Returns the list of features contained in the store.
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsvectorlayer.h
Expand Up @@ -881,7 +881,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
* \see addFeatures()
* \returns true in case of success and false in case of failure
*/
bool addFeature( QgsFeature &feature SIP_INOUT ) override;
bool addFeature( QgsFeature &feature ) override;

/** Updates an existing feature. This method needs to query the datasource
on every call. Consider using changeAttributeValue() or
Expand Down Expand Up @@ -1205,7 +1205,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
*/
bool deleteAttributes( QList<int> attrs );

bool addFeatures( QgsFeatureList &features SIP_INOUT ) override;
bool addFeatures( QgsFeatureList &features ) override;

//! Delete a feature from the layer (but does not commit it)
bool deleteFeature( QgsFeatureId fid );
Expand Down

0 comments on commit 1280779

Please sign in to comment.