Skip to content

Commit

Permalink
Add missing const to equality operator
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 11, 2014
1 parent 3a64b44 commit cee539a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions python/core/qgsdatadefined.sip
Expand Up @@ -76,7 +76,7 @@ class QgsDataDefined
*/
bool setFromXmlElement( const QDomElement& element );

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

};
4 changes: 2 additions & 2 deletions src/core/qgsdatadefined.cpp
Expand Up @@ -161,13 +161,13 @@ bool QgsDataDefined::setFromXmlElement( const QDomElement &element )
return true;
}

bool QgsDataDefined::operator==( const QgsDataDefined &other )
bool QgsDataDefined::operator==( const QgsDataDefined &other ) const
{
return other.isActive() == mActive && other.useExpression() == mUseExpression &&
other.field() == mField && other.expressionString() == mExpressionString;
}

bool QgsDataDefined::operator!=( const QgsDataDefined &other )
bool QgsDataDefined::operator!=( const QgsDataDefined &other ) const
{
return !( *this == other );
}
4 changes: 2 additions & 2 deletions src/core/qgsdatadefined.h
Expand Up @@ -98,8 +98,8 @@ class CORE_EXPORT QgsDataDefined
*/
bool setFromXmlElement( const QDomElement& element );

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

private:
QgsExpression* mExpression;
Expand Down

0 comments on commit cee539a

Please sign in to comment.