Navigation Menu

Skip to content

Commit

Permalink
Add final for sip >= 4.19
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Sep 19, 2018
1 parent d9f5d53 commit 8d9c96c
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 42 deletions.
74 changes: 37 additions & 37 deletions python/core/auto_generated/qgsvectorlayer.sip.in
Expand Up @@ -404,7 +404,7 @@ Uses :py:class:`QgsExpression`
:return: The expression which will be used to preview features for this layer
%End

QgsVectorDataProvider *dataProvider() final;
QgsVectorDataProvider *dataProvider() ${SIP_FINAL};

void setProviderEncoding( const QString &encoding );
%Docstring
Expand Down Expand Up @@ -442,7 +442,7 @@ Returns the join buffer object.
%End
const QList<QgsVectorLayerJoinInfo> vectorJoins() const;

bool setDependencies( const QSet<QgsMapLayerDependency> &layers ) final;
bool setDependencies( const QSet<QgsMapLayerDependency> &layers ) ${SIP_FINAL};
%Docstring
Sets the list of dependencies.

Expand All @@ -455,7 +455,7 @@ Sets the list of dependencies.
.. versionadded:: 3.0
%End

QSet<QgsMapLayerDependency> dependencies() const final;
QSet<QgsMapLayerDependency> dependencies() const ${SIP_FINAL};
%Docstring
Gets the list of dependencies. This includes data dependencies set by the user (:py:func:`setDataDependencies`)
as well as dependencies given by the provider
Expand Down Expand Up @@ -721,7 +721,7 @@ Ownership is transferred.
Returns point, line or polygon
%End

QgsWkbTypes::Type wkbType() const final;
QgsWkbTypes::Type wkbType() const ${SIP_FINAL};
%Docstring
Returns the WKBType or WKBUnknown in case of error
%End
Expand All @@ -731,10 +731,10 @@ Returns the WKBType or WKBUnknown in case of error
Returns the provider type for this layer
%End

QgsCoordinateReferenceSystem sourceCrs() const final;
QString sourceName() const final;
QgsCoordinateReferenceSystem sourceCrs() const ${SIP_FINAL};
QString sourceName() const ${SIP_FINAL};

bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context ) final;
bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context ) ${SIP_FINAL};
%Docstring
Reads vector layer specific state from project file Dom node.

Expand All @@ -743,7 +743,7 @@ Reads vector layer specific state from project file Dom node.
Called by :py:func:`QgsMapLayer.readXml()`
%End

bool writeXml( QDomNode &layer_node, QDomDocument &doc, const QgsReadWriteContext &context ) const final;
bool writeXml( QDomNode &layer_node, QDomDocument &doc, const QgsReadWriteContext &context ) const ${SIP_FINAL};
%Docstring
Write vector layer specific state to project file Dom node.

Expand All @@ -752,10 +752,10 @@ Write vector layer specific state to project file Dom node.
Called by :py:func:`QgsMapLayer.writeXml()`
%End

QString encodedSource( const QString &source, const QgsReadWriteContext &context ) const final;
QString decodedSource( const QString &source, const QString &provider, const QgsReadWriteContext &context ) const final;
QString encodedSource( const QString &source, const QgsReadWriteContext &context ) const ${SIP_FINAL};
QString decodedSource( const QString &source, const QString &provider, const QgsReadWriteContext &context ) const ${SIP_FINAL};

void resolveReferences( QgsProject *project ) final;
void resolveReferences( QgsProject *project ) ${SIP_FINAL};
%Docstring
Resolve references to other layers (kept as layer IDs after reading XML) into layer objects.

Expand Down Expand Up @@ -821,7 +821,7 @@ Load a named style from file/local db/datasource db
%End

QString loadNamedStyle( const QString &theURI, bool &resultFlag /Out/,
QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) final;
QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) ${SIP_FINAL};
%Docstring
Calls loadNamedStyle( theURI, resultFlag, false );
Retained for backward compatibility
Expand Down Expand Up @@ -862,7 +862,7 @@ Returns the current auxiliary layer.


bool readSymbology( const QDomNode &layerNode, QString &errorMessage,
QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) final;
QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) ${SIP_FINAL};
%Docstring
Read the symbology for the current layer from the Dom node supplied.

Expand All @@ -875,7 +875,7 @@ Read the symbology for the current layer from the Dom node supplied.
%End

bool readStyle( const QDomNode &node, QString &errorMessage,
QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) final;
QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) ${SIP_FINAL};
%Docstring
Read the style for the current layer from the Dom node supplied.

Expand All @@ -888,7 +888,7 @@ Read the style for the current layer from the Dom node supplied.
%End

bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage,
const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const final;
const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const ${SIP_FINAL};
%Docstring
Write the symbology for the layer into the docment provided.

Expand All @@ -902,7 +902,7 @@ Write the symbology for the layer into the docment provided.
%End

bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage,
const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const final;
const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const ${SIP_FINAL};
%Docstring
Write just the style information for the layer into the document

Expand All @@ -927,7 +927,7 @@ Writes the symbology of the layer into the document provided in SLD 1.1 format
:return: true in case of success
%End

bool readSld( const QDomNode &node, QString &errorMessage ) final;
bool readSld( const QDomNode &node, QString &errorMessage ) ${SIP_FINAL};

long featureCount( const QString &legendKey ) const;
%Docstring
Expand All @@ -937,7 +937,7 @@ calculated by countSymbolFeatures()
:return: number of features rendered by symbol or -1 if failed or counts are not available
%End

FeatureAvailability hasFeatures() const final;
FeatureAvailability hasFeatures() const ${SIP_FINAL};
%Docstring
Determines if this vector layer has features.

Expand Down Expand Up @@ -984,7 +984,7 @@ if the geometry type of the new data source matches the current geometry type of
.. versionadded:: 3.2
%End

QString loadDefaultStyle( bool &resultFlag /Out/ ) final;
QString loadDefaultStyle( bool &resultFlag /Out/ ) ${SIP_FINAL};

QgsVectorLayerFeatureCounter *countSymbolFeatures();
%Docstring
Expand Down Expand Up @@ -1020,7 +1020,7 @@ Returns the string (typically sql) used to define a subset of the layer.
:return: The subset string or null QString if not implemented by the provider
%End

QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const final;
QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const ${SIP_FINAL};
%Docstring
Query the layer for features specified in request.

Expand Down Expand Up @@ -1050,7 +1050,7 @@ Query the layer for the features with the given ids.
Query the layer for the features which intersect the specified rectangle.
%End

bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = 0 ) final;
bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = 0 ) ${SIP_FINAL};

bool updateFeature( QgsFeature &feature, bool skipDefaultValues = false );
%Docstring
Expand Down Expand Up @@ -1412,12 +1412,12 @@ Set labeling configuration. Takes ownership of the object.
.. versionadded:: 3.0
%End

bool isEditable() const final;
bool isEditable() const ${SIP_FINAL};
%Docstring
Returns true if the provider is in editing mode
%End

bool isSpatial() const final;
bool isSpatial() const ${SIP_FINAL};
%Docstring
Returns true if this is a geometry layer and false in case of NoGeometry (table only) or UnknownGeometry
%End
Expand All @@ -1435,22 +1435,22 @@ false otherwise.
.. versionadded:: 3.0
%End

void reload() final;
void reload() ${SIP_FINAL};
%Docstring
Synchronises with changes in the datasource
%End

QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) final /Factory/;
QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) ${SIP_FINAL} /Factory/;
%Docstring
Returns new instance of QgsMapLayerRenderer that will be used for rendering of given context

.. versionadded:: 2.4
%End

QgsRectangle extent() const final;
QgsRectangle sourceExtent() const final;
QgsRectangle extent() const ${SIP_FINAL};
QgsRectangle sourceExtent() const ${SIP_FINAL};

QgsFields fields() const final;
QgsFields fields() const ${SIP_FINAL};
%Docstring
Returns the list of fields of this layer.
This also includes fields which have not yet been saved to the provider.
Expand All @@ -1468,7 +1468,7 @@ Returns list of attribute indexes. i.e. a list from 0 ... fieldCount()
Returns the list of attributes which make up the layer's primary keys.
%End

long featureCount() const final;
long featureCount() const ${SIP_FINAL};
%Docstring
Returns feature count including changes which have not yet been committed
If you need only the count of committed features call this method on this layer's provider.
Expand Down Expand Up @@ -1692,7 +1692,7 @@ Deletes a list of attribute fields (but does not commit it)
:return: true if at least one attribute has been deleted
%End

bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = 0 ) final;
bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = 0 ) ${SIP_FINAL};

bool deleteFeature( QgsFeatureId fid );
%Docstring
Expand Down Expand Up @@ -1975,7 +1975,7 @@ for the field at `index`.
.. versionadded:: 3.0
%End

QSet<QVariant> uniqueValues( int fieldIndex, int limit = -1 ) const final;
QSet<QVariant> uniqueValues( int fieldIndex, int limit = -1 ) const ${SIP_FINAL};
%Docstring
Calculates a list of unique values contained within an attribute in the layer. Note that
in some circumstances when unsaved changes are present for the layer then the returned list
Expand Down Expand Up @@ -2009,7 +2009,7 @@ returned list).
:return: list of unique strings containing substring
%End

QVariant minimumValue( int index ) const final;
QVariant minimumValue( int index ) const ${SIP_FINAL};
%Docstring
Returns the minimum value for an attribute column or an invalid variant in case of error.
Note that in some circumstances when unsaved changes are present for the layer then the
Expand All @@ -2021,7 +2021,7 @@ been changed inside the edit buffer then the previous saved value may be returne
.. seealso:: :py:func:`uniqueValues`
%End

QVariant maximumValue( int index ) const final;
QVariant maximumValue( int index ) const ${SIP_FINAL};
%Docstring
Returns the maximum value for an attribute column or an invalid variant in case of error.
Note that in some circumstances when unsaved changes are present for the layer then the
Expand Down Expand Up @@ -2085,7 +2085,7 @@ and 1.0 (fully opaque).
.. versionadded:: 3.0
%End

QString htmlMetadata() const final;
QString htmlMetadata() const ${SIP_FINAL};

void setSimplifyMethod( const QgsVectorSimplifyMethod &simplifyMethod );
%Docstring
Expand Down Expand Up @@ -2153,9 +2153,9 @@ It may also contain embedded expressions.
.. versionadded:: 3.0
%End

QgsExpressionContext createExpressionContext() const final;
QgsExpressionContext createExpressionContext() const ${SIP_FINAL};

QgsExpressionContextScope *createExpressionContextScope() const final /Factory/;
QgsExpressionContextScope *createExpressionContextScope() const ${SIP_FINAL} /Factory/;

QgsEditFormConfig editFormConfig() const;
%Docstring
Expand Down Expand Up @@ -2566,7 +2566,7 @@ Emitted when the feature count for symbols on this layer has been recalculated.
%End

protected:
void setExtent( const QgsRectangle &rect ) final;
void setExtent( const QgsRectangle &rect ) ${SIP_FINAL};
%Docstring
Sets the extent
%End
Expand Down
2 changes: 1 addition & 1 deletion scripts/sipify.pl
Expand Up @@ -965,7 +965,7 @@ sub detect_non_method_member{
do {no warnings 'uninitialized';
$LINE =~ s/^(\s*template\s*<)(?:class|typename) (\w+>)(.*)$/$1$2$3/;
$LINE =~ s/\s*\boverride\b//;
$LINE =~ s/\s*\bSIP_FINAL\b/ final/;
$LINE =~ s/\s*\bSIP_FINAL\b/ \${SIP_FINAL}/;
$LINE =~ s/\s*\bextern \b//;
$LINE =~ s/\s*\bMAYBE_UNUSED \b//;
$LINE =~ s/\s*\bNODISCARD \b//;
Expand Down
8 changes: 4 additions & 4 deletions src/core/qgsvectorlayer.h
Expand Up @@ -2326,6 +2326,10 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
*/
void symbolFeatureCountMapChanged();

protected:
//! Sets the extent
void setExtent( const QgsRectangle &rect ) SIP_FINAL;

private slots:
void invalidateSymbolCountedFlag();
void onFeatureCounterCompleted();
Expand All @@ -2336,10 +2340,6 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
void onSymbolsCounted();
void onDirtyTransaction( const QString &sql, const QString &name );

protected:
//! Sets the extent
void setExtent( const QgsRectangle &rect ) SIP_FINAL;

private:
void updateDefaultValues( QgsFeatureId fid, QgsFeature feature = QgsFeature() );

Expand Down

0 comments on commit 8d9c96c

Please sign in to comment.