Skip to content

Commit b65f725

Browse files
committedSep 19, 2018
Rename SIP_FINAL to FINAL
1 parent 8d9c96c commit b65f725

File tree

5 files changed

+47
-45
lines changed

5 files changed

+47
-45
lines changed
 

‎python/core/auto_generated/qgis.sip.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ typedef unsigned long long qgssize;
232232

233233

234234

235-
236235
/************************************************************************
237236
* This file has been generated automatically from *
238237
* *

‎scripts/sipify.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ sub detect_non_method_member{
965965
do {no warnings 'uninitialized';
966966
$LINE =~ s/^(\s*template\s*<)(?:class|typename) (\w+>)(.*)$/$1$2$3/;
967967
$LINE =~ s/\s*\boverride\b//;
968-
$LINE =~ s/\s*\bSIP_FINAL\b/ \${SIP_FINAL}/;
968+
$LINE =~ s/\s*\bFINAL\b/ \${SIP_FINAL}/;
969969
$LINE =~ s/\s*\bextern \b//;
970970
$LINE =~ s/\s*\bMAYBE_UNUSED \b//;
971971
$LINE =~ s/\s*\bNODISCARD \b//;

‎src/core/qgis.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,8 @@ typedef unsigned long long qgssize;
636636
#define MAYBE_UNUSED
637637
#endif
638638

639-
639+
#ifndef FINAL
640+
#define FINAL final
641+
#endif
640642

641643

‎src/core/qgis_sip.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,10 @@
202202
* we will have build issues because it tries to override final methods.
203203
*/
204204
#if SIP_VERSION >= 0x041300
205-
#define SIP_FINAL final
206-
#else
207-
#define SIP_FINAL override
205+
#if defined FINAL
206+
#undef FINAL
207+
#endif
208+
#define FINAL override
208209
#endif
209210

210211
/*

‎src/core/qgsvectorlayer.h

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,8 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
484484
*/
485485
QString displayExpression() const;
486486

487-
QgsVectorDataProvider *dataProvider() SIP_FINAL;
488-
const QgsVectorDataProvider *dataProvider() const SIP_FINAL SIP_SKIP;
487+
QgsVectorDataProvider *dataProvider() FINAL;
488+
const QgsVectorDataProvider *dataProvider() const FINAL SIP_SKIP;
489489

490490
//! Sets the textencoding of the data provider
491491
void setProviderEncoding( const QString &encoding );
@@ -519,7 +519,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
519519
* \returns false if a dependency cycle has been detected
520520
* \since QGIS 3.0
521521
*/
522-
bool setDependencies( const QSet<QgsMapLayerDependency> &layers ) SIP_FINAL;
522+
bool setDependencies( const QSet<QgsMapLayerDependency> &layers ) FINAL;
523523

524524
/**
525525
* Gets the list of dependencies. This includes data dependencies set by the user (\see setDataDependencies)
@@ -528,7 +528,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
528528
* \returns a set of QgsMapLayerDependency
529529
* \since QGIS 3.0
530530
*/
531-
QSet<QgsMapLayerDependency> dependencies() const SIP_FINAL;
531+
QSet<QgsMapLayerDependency> dependencies() const FINAL;
532532

533533
/**
534534
* Add a new field which is calculated by the expression specified
@@ -752,34 +752,34 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
752752
QgsWkbTypes::GeometryType geometryType() const;
753753

754754
//! Returns the WKBType or WKBUnknown in case of error
755-
QgsWkbTypes::Type wkbType() const SIP_FINAL;
755+
QgsWkbTypes::Type wkbType() const FINAL;
756756

757757
//! Returns the provider type for this layer
758758
QString providerType() const;
759759

760-
QgsCoordinateReferenceSystem sourceCrs() const SIP_FINAL;
761-
QString sourceName() const SIP_FINAL;
760+
QgsCoordinateReferenceSystem sourceCrs() const FINAL;
761+
QString sourceName() const FINAL;
762762

763763
/**
764764
* Reads vector layer specific state from project file Dom node.
765765
* \note Called by QgsMapLayer::readXml().
766766
*/
767-
bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context ) SIP_FINAL;
767+
bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context ) FINAL;
768768

769769
/**
770770
* Write vector layer specific state to project file Dom node.
771771
* \note Called by QgsMapLayer::writeXml().
772772
*/
773-
bool writeXml( QDomNode &layer_node, QDomDocument &doc, const QgsReadWriteContext &context ) const SIP_FINAL;
773+
bool writeXml( QDomNode &layer_node, QDomDocument &doc, const QgsReadWriteContext &context ) const FINAL;
774774

775-
QString encodedSource( const QString &source, const QgsReadWriteContext &context ) const SIP_FINAL;
776-
QString decodedSource( const QString &source, const QString &provider, const QgsReadWriteContext &context ) const SIP_FINAL;
775+
QString encodedSource( const QString &source, const QgsReadWriteContext &context ) const FINAL;
776+
QString decodedSource( const QString &source, const QString &provider, const QgsReadWriteContext &context ) const FINAL;
777777

778778
/**
779779
* Resolve references to other layers (kept as layer IDs after reading XML) into layer objects.
780780
* \since QGIS 3.0
781781
*/
782-
void resolveReferences( QgsProject *project ) SIP_FINAL;
782+
void resolveReferences( QgsProject *project ) FINAL;
783783

784784
/**
785785
* Save named and sld style of the layer to the style table in the db.
@@ -834,7 +834,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
834834
* Retained for backward compatibility
835835
*/
836836
QString loadNamedStyle( const QString &theURI, bool &resultFlag SIP_OUT,
837-
QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) SIP_FINAL;
837+
QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) FINAL;
838838

839839
/**
840840
* Loads the auxiliary layer for this vector layer. If there's no
@@ -885,7 +885,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
885885
* \returns true in case of success.
886886
*/
887887
bool readSymbology( const QDomNode &layerNode, QString &errorMessage,
888-
QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) SIP_FINAL;
888+
QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) FINAL;
889889

890890
/**
891891
* Read the style for the current layer from the Dom node supplied.
@@ -896,7 +896,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
896896
* \returns true in case of success.
897897
*/
898898
bool readStyle( const QDomNode &node, QString &errorMessage,
899-
QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) SIP_FINAL;
899+
QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) FINAL;
900900

901901
/**
902902
* Write the symbology for the layer into the docment provided.
@@ -908,7 +908,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
908908
* \returns true in case of success.
909909
*/
910910
bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage,
911-
const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const SIP_FINAL;
911+
const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const FINAL;
912912

913913
/**
914914
* Write just the style information for the layer into the document
@@ -920,7 +920,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
920920
* \returns true in case of success.
921921
*/
922922
bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage,
923-
const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const SIP_FINAL;
923+
const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const FINAL;
924924

925925
/**
926926
* Writes the symbology of the layer into the document provided in SLD 1.1 format
@@ -932,7 +932,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
932932
*/
933933
bool writeSld( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsStringMap &props = QgsStringMap() ) const;
934934

935-
bool readSld( const QDomNode &node, QString &errorMessage ) SIP_FINAL;
935+
bool readSld( const QDomNode &node, QString &errorMessage ) FINAL;
936936

937937
/**
938938
* Number of features rendered with specified legend key. Features must be first
@@ -951,7 +951,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
951951
*
952952
* \since QGIS 3.4
953953
*/
954-
FeatureAvailability hasFeatures() const SIP_FINAL;
954+
FeatureAvailability hasFeatures() const FINAL;
955955

956956
/**
957957
* Update the data source of the layer. The layer's renderer and legend will be preserved only
@@ -980,7 +980,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
980980
*/
981981
void setDataSource( const QString &dataSource, const QString &baseName, const QString &provider, const QgsDataProvider::ProviderOptions &options, bool loadDefaultStyleFlag = false );
982982

983-
QString loadDefaultStyle( bool &resultFlag SIP_OUT ) SIP_FINAL;
983+
QString loadDefaultStyle( bool &resultFlag SIP_OUT ) FINAL;
984984

985985
/**
986986
* Count features for symbols.
@@ -1016,7 +1016,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
10161016
* \param request feature request describing parameters of features to return
10171017
* \returns iterator for matching features from provider
10181018
*/
1019-
QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const SIP_FINAL;
1019+
QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const FINAL;
10201020

10211021
/**
10221022
* Query the layer for features matching a given expression.
@@ -1053,7 +1053,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
10531053
return getFeatures( QgsFeatureRequest( rectangle ) );
10541054
}
10551055

1056-
bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = nullptr ) SIP_FINAL;
1056+
bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = nullptr ) FINAL;
10571057

10581058
/**
10591059
* Updates an existing \a feature in the layer, replacing the attributes and geometry for the feature
@@ -1335,10 +1335,10 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
13351335
void setLabeling( QgsAbstractVectorLayerLabeling *labeling SIP_TRANSFER );
13361336

13371337
//! Returns true if the provider is in editing mode
1338-
bool isEditable() const SIP_FINAL;
1338+
bool isEditable() const FINAL;
13391339

13401340
//! Returns true if this is a geometry layer and false in case of NoGeometry (table only) or UnknownGeometry
1341-
bool isSpatial() const SIP_FINAL;
1341+
bool isSpatial() const FINAL;
13421342

13431343
//! Returns true if the provider has been modified since the last commit
13441344
virtual bool isModified() const;
@@ -1352,24 +1352,24 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
13521352
bool isAuxiliaryField( int index, int &srcIndex ) const;
13531353

13541354
//! Synchronises with changes in the datasource
1355-
void reload() SIP_FINAL;
1355+
void reload() FINAL;
13561356

13571357
/**
13581358
* Returns new instance of QgsMapLayerRenderer that will be used for rendering of given context
13591359
* \since QGIS 2.4
13601360
*/
1361-
QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) SIP_FINAL SIP_FACTORY;
1361+
QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) FINAL SIP_FACTORY;
13621362

1363-
QgsRectangle extent() const SIP_FINAL;
1364-
QgsRectangle sourceExtent() const SIP_FINAL;
1363+
QgsRectangle extent() const FINAL;
1364+
QgsRectangle sourceExtent() const FINAL;
13651365

13661366
/**
13671367
* Returns the list of fields of this layer.
13681368
* This also includes fields which have not yet been saved to the provider.
13691369
*
13701370
* \returns A list of fields
13711371
*/
1372-
QgsFields fields() const SIP_FINAL;
1372+
QgsFields fields() const FINAL;
13731373

13741374
/**
13751375
* Returns list of attribute indexes. i.e. a list from 0 ... fieldCount()
@@ -1385,7 +1385,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
13851385
* Returns feature count including changes which have not yet been committed
13861386
* If you need only the count of committed features call this method on this layer's provider.
13871387
*/
1388-
long featureCount() const SIP_FINAL;
1388+
long featureCount() const FINAL;
13891389

13901390
/**
13911391
* Make layer read-only (editing disabled) or not
@@ -1574,7 +1574,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
15741574
*/
15751575
bool deleteAttributes( const QList<int> &attrs );
15761576

1577-
bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = nullptr ) SIP_FINAL;
1577+
bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = nullptr ) FINAL;
15781578

15791579
/**
15801580
* Deletes a feature from the layer (but does not commit it).
@@ -1819,7 +1819,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
18191819
* \see minimumValue()
18201820
* \see maximumValue()
18211821
*/
1822-
QSet<QVariant> uniqueValues( int fieldIndex, int limit = -1 ) const SIP_FINAL;
1822+
QSet<QVariant> uniqueValues( int fieldIndex, int limit = -1 ) const FINAL;
18231823

18241824
/**
18251825
* Returns unique string values of an attribute which contain a specified subset string. Subset
@@ -1845,7 +1845,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
18451845
* \see maximumValue()
18461846
* \see uniqueValues()
18471847
*/
1848-
QVariant minimumValue( int index ) const SIP_FINAL;
1848+
QVariant minimumValue( int index ) const FINAL;
18491849

18501850
/**
18511851
* Returns the maximum value for an attribute column or an invalid variant in case of error.
@@ -1855,7 +1855,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
18551855
* \see minimumValue()
18561856
* \see uniqueValues()
18571857
*/
1858-
QVariant maximumValue( int index ) const SIP_FINAL;
1858+
QVariant maximumValue( int index ) const FINAL;
18591859

18601860
/**
18611861
* Calculates an aggregated value from the layer's features.
@@ -1896,7 +1896,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
18961896
*/
18971897
double opacity() const;
18981898

1899-
QString htmlMetadata() const SIP_FINAL;
1899+
QString htmlMetadata() const FINAL;
19001900

19011901
/**
19021902
* Set the simplification settings for fast rendering of features
@@ -1956,9 +1956,9 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
19561956
*/
19571957
void setMapTipTemplate( const QString &mapTipTemplate );
19581958

1959-
QgsExpressionContext createExpressionContext() const SIP_FINAL;
1959+
QgsExpressionContext createExpressionContext() const FINAL;
19601960

1961-
QgsExpressionContextScope *createExpressionContextScope() const SIP_FINAL SIP_FACTORY;
1961+
QgsExpressionContextScope *createExpressionContextScope() const FINAL SIP_FACTORY;
19621962

19631963
/**
19641964
* Returns the configuration of the form used to represent this vector layer.
@@ -2328,7 +2328,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
23282328

23292329
protected:
23302330
//! Sets the extent
2331-
void setExtent( const QgsRectangle &rect ) SIP_FINAL;
2331+
void setExtent( const QgsRectangle &rect ) FINAL;
23322332

23332333
private slots:
23342334
void invalidateSymbolCountedFlag();
@@ -2346,7 +2346,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
23462346
/**
23472347
* Returns true if the provider is in read-only mode
23482348
*/
2349-
bool isReadOnly() const SIP_FINAL;
2349+
bool isReadOnly() const FINAL;
23502350

23512351
/**
23522352
* Bind layer to a specific data provider

0 commit comments

Comments
 (0)
Please sign in to comment.