Add missing const to equality operator

This commit is contained in:
Nyall Dawson 2014-12-12 06:20:58 +11:00
parent 3a64b446e3
commit cee539aae8
3 changed files with 6 additions and 6 deletions

View File

@ -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;
};

View File

@ -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 );
}

View File

@ -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;