Skip to content

Commit

Permalink
Use correct layer comparators when comparing layer sources in processing
Browse files Browse the repository at this point in the history
Fixes #37394
  • Loading branch information
nyalldawson committed Jul 6, 2020
1 parent fe9f7e1 commit 398b55e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Expand Up @@ -95,9 +95,9 @@ You can use QgsXmlUtils.readVariant to load it from an XML document.
.. versionadded:: 3.14
%End

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

bool operator!=( const QgsProcessingFeatureSourceDefinition &other );
bool operator!=( const QgsProcessingFeatureSourceDefinition &other ) const;

operator QVariant() const;

Expand Down
4 changes: 2 additions & 2 deletions src/core/processing/qgsprocessingparameters.h
Expand Up @@ -162,7 +162,7 @@ class CORE_EXPORT QgsProcessingFeatureSourceDefinition
*/
bool loadVariant( const QVariantMap &map );

bool operator==( const QgsProcessingFeatureSourceDefinition &other )
bool operator==( const QgsProcessingFeatureSourceDefinition &other ) const
{
return source == other.source
&& selectedFeaturesOnly == other.selectedFeaturesOnly
Expand All @@ -171,7 +171,7 @@ class CORE_EXPORT QgsProcessingFeatureSourceDefinition
&& geometryCheck == other.geometryCheck;
}

bool operator!=( const QgsProcessingFeatureSourceDefinition &other )
bool operator!=( const QgsProcessingFeatureSourceDefinition &other ) const
{
return !( *this == other );
}
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgsapplication.cpp
Expand Up @@ -236,6 +236,8 @@ void QgsApplication::init( QString profileFolder )
qRegisterMetaType<QgsRemappingSinkDefinition>( "QgsRemappingSinkDefinition" );
qRegisterMetaType<QgsProcessingModelChildDependency>( "QgsProcessingModelChildDependency" );
QMetaType::registerComparators<QgsProcessingModelChildDependency>();
QMetaType::registerEqualsComparator<QgsProcessingFeatureSourceDefinition>();
QMetaType::registerEqualsComparator<QgsProperty>();

( void ) resolvePkgPath();

Expand Down

0 comments on commit 398b55e

Please sign in to comment.