Skip to content

Commit

Permalink
Add c++20 todo for replacing equality operators with default implemen…
Browse files Browse the repository at this point in the history
…tations
  • Loading branch information
nyalldawson authored and PeterPetrik committed Jul 2, 2021
1 parent 65bccd2 commit 6c2e38b
Show file tree
Hide file tree
Showing 50 changed files with 70 additions and 4 deletions.
Expand Up @@ -132,6 +132,7 @@ Create a new Change
QgsGeometryCheck::ChangeType type;

QgsVertexId vidx;

bool operator==( const QgsGeometryCheck::Change &other );
};

Expand Down
1 change: 1 addition & 0 deletions python/core/auto_generated/auth/qgsauthconfig.sip.in
Expand Up @@ -31,6 +31,7 @@ Construct a configuration for an authentication method
:param version: Version of the configuration (for updating previously saved configs later on)
%End


bool operator==( const QgsAuthMethodConfig &other ) const;

bool operator!=( const QgsAuthMethodConfig &other ) const;
Expand Down
Expand Up @@ -85,7 +85,6 @@ Copy constructor
%End
~QgsEditFormConfig();


bool operator==( const QgsEditFormConfig &o );

void addTab( QgsAttributeEditorElement *data /Transfer/ );
Expand Down
1 change: 1 addition & 0 deletions python/core/auto_generated/geometry/qgslinesegment.sip.in
Expand Up @@ -191,6 +191,7 @@ on the line, or exactly in line with the segment) and the result is undefined.
Reverses the line segment, so that the start and end points are flipped.
%End


bool operator==( const QgsLineSegment2D &other ) const /HoldGIL/;

bool operator!=( const QgsLineSegment2D &other ) const /HoldGIL/;
Expand Down
1 change: 1 addition & 0 deletions python/core/auto_generated/qgsdefaultvalue.sip.in
Expand Up @@ -44,6 +44,7 @@ Create a new default value with the given ``expression`` and ``applyOnUpdate`` f

.. seealso:: :py:func:`QgsVectorLayer.setDefaultValueDefinition`
%End

bool operator==( const QgsDefaultValue &other ) const;

QString expression() const;
Expand Down
1 change: 1 addition & 0 deletions python/core/auto_generated/qgsmaplayerdependency.sip.in
Expand Up @@ -60,6 +60,7 @@ Returns the dependency origin
Returns the ID of the layer this dependency depends on
%End


bool operator==( const QgsMapLayerDependency &other ) const;

//! hash operator
Expand Down
1 change: 1 addition & 0 deletions python/core/auto_generated/qgsreadwritecontext.sip.in
Expand Up @@ -45,6 +45,7 @@ Returns the message level
Returns the stack of categories of the message
%End


bool operator==( const QgsReadWriteContext::ReadWriteMessage &other ) const;

bool operator!=( const QgsReadWriteContext::ReadWriteMessage &other ) const;
Expand Down
Expand Up @@ -69,6 +69,7 @@ Returns the key associated to the symbol
Returns the symbol layer index path inside the symbol
%End


bool operator==( const QgsSymbolLayerId &other ) const;

bool operator<( const QgsSymbolLayerId &other ) const;
Expand Down
1 change: 1 addition & 0 deletions src/3d/chunks/qgschunknode_p.h
Expand Up @@ -68,6 +68,7 @@ struct QgsChunkNodeId
return QStringLiteral( "%1/%2/%3/%4" ).arg( d ).arg( x ).arg( y ).arg( z ); // octree
}

// TODO c++20 - replace with = default
bool operator==( const QgsChunkNodeId &other ) const
{
return d == other.d && x == other.x && y == other.y && z == other.z;
Expand Down
1 change: 1 addition & 0 deletions src/3d/materials/qgsgoochmaterialsettings.h
Expand Up @@ -108,6 +108,7 @@ class _3D_EXPORT QgsGoochMaterialSettings : public QgsAbstractMaterialSettings

#endif

// TODO c++20 - replace with = default
bool operator==( const QgsGoochMaterialSettings &other ) const
{
return mDiffuse == other.mDiffuse &&
Expand Down
1 change: 1 addition & 0 deletions src/3d/materials/qgsphongmaterialsettings.h
Expand Up @@ -96,6 +96,7 @@ class _3D_EXPORT QgsPhongMaterialSettings : public QgsAbstractMaterialSettings
void applyDataDefinedToGeometry( Qt3DRender::QGeometry *geometry, int vertexCount, const QByteArray &data ) const override;
#endif

// TODO c++20 - replace with = default
bool operator==( const QgsPhongMaterialSettings &other ) const
{
return mAmbient == other.mAmbient &&
Expand Down
1 change: 1 addition & 0 deletions src/3d/materials/qgsphongtexturedmaterialsettings.h
Expand Up @@ -120,6 +120,7 @@ class _3D_EXPORT QgsPhongTexturedMaterialSettings : public QgsAbstractMaterialSe
void addParametersToEffect( Qt3DRender::QEffect *effect ) const override;
#endif

// TODO c++20 - replace with = default
bool operator==( const QgsPhongTexturedMaterialSettings &other ) const
{
return mAmbient == other.mAmbient &&
Expand Down
1 change: 1 addition & 0 deletions src/3d/materials/qgssimplelinematerialsettings.h
Expand Up @@ -78,6 +78,7 @@ class _3D_EXPORT QgsSimpleLineMaterialSettings : public QgsAbstractMaterialSetti
void addParametersToEffect( Qt3DRender::QEffect *effect ) const override;
#endif

// TODO c++20 - replace with = default
bool operator==( const QgsSimpleLineMaterialSettings &other ) const
{
return mAmbient == other.mAmbient;
Expand Down
1 change: 1 addition & 0 deletions src/3d/qgscamerapose.h
Expand Up @@ -75,6 +75,7 @@ class _3D_EXPORT QgsCameraPose
//! Reads configuration from a DOM element previously written using writeXml()
void readXml( const QDomElement &elem );

// TODO c++20 - replace with = default
bool operator==( const QgsCameraPose &other ) const
{
return mCenterPoint == other.mCenterPoint &&
Expand Down
1 change: 1 addition & 0 deletions src/3d/qgsdirectionallightsettings.h
Expand Up @@ -55,6 +55,7 @@ class _3D_EXPORT QgsDirectionalLightSettings
//! Reads configuration from a DOM element previously written using writeXml()
void readXml( const QDomElement &elem );

// TODO c++20 - replace with = default
bool operator==( const QgsDirectionalLightSettings &other );

private:
Expand Down
1 change: 1 addition & 0 deletions src/3d/qgspointlightsettings.h
Expand Up @@ -76,6 +76,7 @@ class _3D_EXPORT QgsPointLightSettings
//! Reads configuration from a DOM element previously written using writeXml()
void readXml( const QDomElement &elem );

// TODO c++20 - replace with = default
bool operator==( const QgsPointLightSettings &other );

private:
Expand Down
1 change: 1 addition & 0 deletions src/3d/qgsraycastingutils_p.h
Expand Up @@ -75,6 +75,7 @@ namespace QgsRayCastingUtils
Ray3D &transform( const QMatrix4x4 &matrix );
Ray3D transformed( const QMatrix4x4 &matrix ) const;

// TODO c++20 - replace with = default
bool operator==( const Ray3D &other ) const;
bool operator!=( const Ray3D &other ) const;

Expand Down
1 change: 1 addition & 0 deletions src/analysis/interpolation/Vector3D.h
Expand Up @@ -48,6 +48,7 @@ class ANALYSIS_EXPORT Vector3D
//! Default constructor
Vector3D() = default;

// TODO c++20 - replace with = default
bool operator==( const Vector3D &v ) const;
bool operator!=( const Vector3D &v ) const;
//! Returns the x-component of the vector
Expand Down
2 changes: 2 additions & 0 deletions src/analysis/vector/geometry_checker/qgsgeometrycheck.h
Expand Up @@ -200,6 +200,8 @@ class ANALYSIS_EXPORT QgsGeometryCheck
* The index of the part / ring / vertex, depending on \see what.
*/
QgsVertexId vidx;

// TODO c++20 - replace with = default
bool operator==( const QgsGeometryCheck::Change &other )
{
return what == other.what && type == other.type && vidx == other.vidx;
Expand Down
1 change: 1 addition & 0 deletions src/app/vertextool/qgsvertextool.h
Expand Up @@ -42,6 +42,7 @@ struct Vertex
, fid( fid )
, vertexId( vertexId ) {}

// TODO c++20 - replace with = default
bool operator==( const Vertex &other ) const
{
return layer == other.layer && fid == other.fid && vertexId == other.vertexId;
Expand Down
2 changes: 2 additions & 0 deletions src/core/auth/qgsauthconfig.h
Expand Up @@ -49,6 +49,8 @@ class CORE_EXPORT QgsAuthMethodConfig
*/
QgsAuthMethodConfig( const QString &method = QString(), int version = 0 );

// TODO c++20 - replace with = default

//! Operator used to compare configs' equality
bool operator==( const QgsAuthMethodConfig &other ) const;

Expand Down
2 changes: 1 addition & 1 deletion src/core/editform/qgseditformconfig.h
Expand Up @@ -124,7 +124,7 @@ class CORE_EXPORT QgsEditFormConfig
~QgsEditFormConfig();

QgsEditFormConfig &operator=( const QgsEditFormConfig &o );

// TODO c++20 - replace with = default
bool operator==( const QgsEditFormConfig &o );

/**
Expand Down
1 change: 1 addition & 0 deletions src/core/geometry/qgsgeometry.h
Expand Up @@ -2312,6 +2312,7 @@ class CORE_EXPORT QgsGeometry
% End
#endif

// TODO c++20 - replace with = default
bool operator==( const QgsGeometry::Error &other ) const
{
return other.mMessage == mMessage && other.mHasLocation == mHasLocation && other.mLocation == mLocation;
Expand Down
2 changes: 2 additions & 0 deletions src/core/geometry/qgslinesegment.h
Expand Up @@ -218,6 +218,8 @@ class CORE_EXPORT QgsLineSegment2D
std::swap( mStart, mEnd );
}

// TODO c++20 - replace with = default

//! Equality operator
bool operator==( const QgsLineSegment2D &other ) const SIP_HOLDGIL
{
Expand Down
3 changes: 3 additions & 0 deletions src/core/metadata/qgsabstractmetadatabase.h
Expand Up @@ -127,6 +127,7 @@ class CORE_EXPORT QgsAbstractMetadataBase
*/
QString country;

// TODO c++20 - replace with = default
bool operator==( const QgsAbstractMetadataBase::Address &other ) const;
};

Expand Down Expand Up @@ -188,6 +189,7 @@ class CORE_EXPORT QgsAbstractMetadataBase
*/
QString role;

// TODO c++20 - replace with = default
bool operator==( const QgsAbstractMetadataBase::Contact &other ) const;
};

Expand Down Expand Up @@ -252,6 +254,7 @@ class CORE_EXPORT QgsAbstractMetadataBase
*/
QString size;

// TODO c++20 - replace with = default
bool operator==( const QgsAbstractMetadataBase::Link &other ) const;
};

Expand Down
3 changes: 3 additions & 0 deletions src/core/metadata/qgslayermetadata.h
Expand Up @@ -81,6 +81,7 @@ class CORE_EXPORT QgsLayerMetadata : public QgsAbstractMetadataBase
*/
QgsBox3d bounds;

// TODO c++20 - replace with = default
bool operator==( const QgsLayerMetadata::SpatialExtent &other ) const;
};

Expand Down Expand Up @@ -118,6 +119,7 @@ class CORE_EXPORT QgsLayerMetadata : public QgsAbstractMetadataBase
*/
void setTemporalExtents( const QList< QgsDateTimeRange > &extents );

// TODO c++20 - replace with = default
bool operator==( const QgsLayerMetadata::Extent &other ) const;

#ifndef SIP_RUN
Expand Down Expand Up @@ -155,6 +157,7 @@ class CORE_EXPORT QgsLayerMetadata : public QgsAbstractMetadataBase
*/
QString constraint;

// TODO c++20 - replace with = default
bool operator==( const QgsLayerMetadata::Constraint &other ) const;

};
Expand Down
2 changes: 2 additions & 0 deletions src/core/pointcloud/qgspointcloudindex.h
Expand Up @@ -62,6 +62,8 @@ class CORE_EXPORT IndexedPointCloudNode
//! Returns whether node is valid
bool isValid() const { return mD >= 0; }

// TODO c++20 - replace with = default

//! Compares nodes
bool operator==( IndexedPointCloudNode other ) const
{
Expand Down
Expand Up @@ -72,6 +72,7 @@ class CORE_EXPORT QgsProcessingModelChildDependency
return true;
}

// TODO c++20 - replace with = default
bool operator==( const QgsProcessingModelChildDependency &other ) const
{
return childId == other.childId && conditionalBranch == other.conditionalBranch;
Expand Down
2 changes: 2 additions & 0 deletions src/core/processing/qgsprocessingparameters.h
Expand Up @@ -162,6 +162,7 @@ class CORE_EXPORT QgsProcessingFeatureSourceDefinition
*/
bool loadVariant( const QVariantMap &map );

// TODO c++20 - replace with = default
bool operator==( const QgsProcessingFeatureSourceDefinition &other ) const
{
return source == other.source
Expand Down Expand Up @@ -296,6 +297,7 @@ class CORE_EXPORT QgsProcessingOutputLayerDefinition
return QVariant::fromValue( *this );
}

// TODO c++20 - replace with = default
bool operator==( const QgsProcessingOutputLayerDefinition &other ) const;
bool operator!=( const QgsProcessingOutputLayerDefinition &other ) const;

Expand Down
1 change: 1 addition & 0 deletions src/core/proj/qgscoordinatetransformcontext_p.h
Expand Up @@ -64,6 +64,7 @@ class QgsCoordinateTransformContextPrivate : public QSharedData
QString operation;
bool allowFallback = true;

// TODO c++20 - replace with = default
bool operator==( const OperationDetails &other ) const
{
return operation == other.operation && allowFallback == other.allowFallback;
Expand Down
1 change: 1 addition & 0 deletions src/core/proj/qgsdatumtransform.h
Expand Up @@ -73,6 +73,7 @@ class CORE_EXPORT QgsDatumTransform
*/
int destinationTransformId = -1;

// TODO c++20 - replace with = default
bool operator==( QgsDatumTransform::TransformPair other ) const
{
return other.sourceTransformId == sourceTransformId && other.destinationTransformId == destinationTransformId;
Expand Down
1 change: 1 addition & 0 deletions src/core/providers/qgsabstractdatabaseproviderconnection.h
Expand Up @@ -234,6 +234,7 @@ class CORE_EXPORT QgsAbstractDatabaseProviderConnection : public QgsAbstractProv
QgsWkbTypes::Type wkbType;
QgsCoordinateReferenceSystem crs;

// TODO c++20 - replace with = default
inline bool operator==( const GeometryColumnType &other ) const
{
return this->crs == other.crs && this->wkbType == other.wkbType;
Expand Down
1 change: 1 addition & 0 deletions src/core/providers/qgsprovidersublayerdetails.h
Expand Up @@ -230,6 +230,7 @@ class CORE_EXPORT QgsProviderSublayerDetails
*/
void setLayerNumber( int number ) { mLayerNumber = number; }

// TODO c++20 - replace with = default
bool operator==( const QgsProviderSublayerDetails &other ) const;
bool operator!=( const QgsProviderSublayerDetails &other ) const;

Expand Down
1 change: 1 addition & 0 deletions src/core/qgsattributetableconfig.h
Expand Up @@ -54,6 +54,7 @@ class CORE_EXPORT QgsAttributeTableConfig
//! Constructor for ColumnConfig
ColumnConfig() = default;

// TODO c++20 - replace with = default
bool operator== ( const QgsAttributeTableConfig::ColumnConfig &other ) const SIP_SKIP;

QgsAttributeTableConfig::Type type = Field; //!< The type of this column.
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsbookmarkmanager.h
Expand Up @@ -116,6 +116,7 @@ class CORE_EXPORT QgsBookmark
% End
#endif

// TODO c++20 - replace with = default
bool operator==( const QgsBookmark &other );
bool operator!=( const QgsBookmark &other );

Expand Down
2 changes: 2 additions & 0 deletions src/core/qgsdefaultvalue.h
Expand Up @@ -59,6 +59,8 @@ class CORE_EXPORT QgsDefaultValue
* \see QgsVectorLayer::setDefaultValueDefinition
*/
explicit QgsDefaultValue( const QString &expression = QString(), bool applyOnUpdate = false );

// TODO c++20 - replace with = default
bool operator==( const QgsDefaultValue &other ) const;

/**
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsfield_p.h
Expand Up @@ -84,6 +84,7 @@ class QgsFieldPrivate : public QSharedData

~QgsFieldPrivate() = default;

// TODO c++20 - replace with = default
bool operator==( const QgsFieldPrivate &other ) const
{
return ( ( name == other.name ) && ( type == other.type ) && ( subType == other.subType )
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsfieldconstraints.h
Expand Up @@ -141,6 +141,7 @@ class CORE_EXPORT QgsFieldConstraints
*/
void setConstraintExpression( const QString &expression, const QString &description = QString() );

// TODO c++20 - replace with = default
bool operator==( const QgsFieldConstraints &other ) const;

private:
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgsfields.h
Expand Up @@ -67,6 +67,8 @@ class CORE_EXPORT QgsFields
, originIndex( oi )
{}

// TODO c++20 - replace with = default

//! \since QGIS 2.6
bool operator==( const Field &other ) const { return field == other.field && origin == other.origin && originIndex == other.originIndex; }
//! \since QGIS 2.6
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgsmaplayerdependency.h
Expand Up @@ -67,6 +67,8 @@ class CORE_EXPORT QgsMapLayerDependency
//! Returns the ID of the layer this dependency depends on
QString layerId() const { return mLayerId; }

// TODO c++20 - replace with = default

//! Comparison operator
bool operator==( const QgsMapLayerDependency &other ) const
{
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsmapthemecollection.h
Expand Up @@ -61,6 +61,7 @@ class CORE_EXPORT QgsMapThemeCollection : public QObject
//! Initialize layer record with a map layer - it will be stored as a weak pointer
MapThemeLayerRecord( QgsMapLayer *l = nullptr ): mLayer( l ) {}

// TODO c++20 - replace with = default
bool operator==( const QgsMapThemeCollection::MapThemeLayerRecord &other ) const
{
return mLayer == other.mLayer && isVisible == other.isVisible &&
Expand Down
1 change: 1 addition & 0 deletions src/core/qgspointlocator.h
Expand Up @@ -276,6 +276,7 @@ class CORE_EXPORT QgsPointLocator : public QObject
return point;
}

// TODO c++20 - replace with = default
bool operator==( const QgsPointLocator::Match &other ) const
{
return mType == other.mType &&
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgsreadwritecontext.h
Expand Up @@ -57,6 +57,8 @@ class CORE_EXPORT QgsReadWriteContext
//! Returns the stack of categories of the message
QStringList categories() const {return mCategories;}

// TODO c++20 - replace with = default

bool operator==( const QgsReadWriteContext::ReadWriteMessage &other ) const
{
return mMessage == other.mMessage && mLevel == other.mLevel && mCategories == other.mCategories;
Expand Down

0 comments on commit 6c2e38b

Please sign in to comment.