Skip to content
Permalink
Browse files

Add some missing consts to operators

  • Loading branch information
nyalldawson committed Oct 27, 2015
1 parent fe221d5 commit 7842391ebaa9fef6ef5caf3297d79da004fbe99d
@@ -10,8 +10,8 @@ class Point3D
Point3D( const Point3D& p );
~Point3D();
// Point3D& operator=( const Point3D& p );
bool operator==( const Point3D& p );
bool operator!=( const Point3D& p );
bool operator==( const Point3D& p ) const;
bool operator!=( const Point3D& p ) const;
/** Calculates the three-dimensional distance to another point*/
double dist3D( Point3D* p ) const;
/** Returns the x-coordinate of the point*/
@@ -14,8 +14,8 @@ class Vector3D
/** Destructor*/
~Vector3D();
// Vector3D& operator=( const Vector3D& v );
bool operator==( const Vector3D& v );
bool operator!=( const Vector3D& v );
bool operator==( const Vector3D& v ) const;
bool operator!=( const Vector3D& v ) const;
/** Returns the x-component of the vector*/
double getX() const;
/** Returns the y-component of the vector*/
@@ -23,15 +23,15 @@ class QgsProjectVersion

/** Boolean equal operator
*/
bool operator==( const QgsProjectVersion &other );
bool operator==( const QgsProjectVersion &other ) const;

/** Boolean >= operator
*/
bool operator>=( const QgsProjectVersion &other );
bool operator>=( const QgsProjectVersion &other ) const;

/** Boolean > operator
*/
bool operator>( const QgsProjectVersion &other );
bool operator>( const QgsProjectVersion &other ) const;

};

@@ -25,12 +25,12 @@ Point3D& Point3D::operator=( const Point3D & p )
return ( *this );
}

bool Point3D::operator==( const Point3D& p )
bool Point3D::operator==( const Point3D& p ) const
{
return ( mX == p.getX() && mY == p.getY() && mZ == p.getZ() );
}

bool Point3D::operator!=( const Point3D& p )
bool Point3D::operator!=( const Point3D& p ) const
{
return ( !(( *this ) == p ) );
}
@@ -36,8 +36,8 @@ class ANALYSIS_EXPORT Point3D
Point3D( const Point3D& p );
~Point3D();
Point3D& operator=( const Point3D& p );
bool operator==( const Point3D& p );
bool operator!=( const Point3D& p );
bool operator==( const Point3D& p ) const;
bool operator!=( const Point3D& p ) const;
/** Calculates the three-dimensional distance to another point*/
double dist3D( Point3D* p ) const;
/** Returns the x-coordinate of the point*/
@@ -37,12 +37,12 @@ Vector3D& Vector3D::operator=( const Vector3D & v )
return ( *this );
}

bool Vector3D::operator==( const Vector3D& v )
bool Vector3D::operator==( const Vector3D& v ) const
{
return ( mX == v.getX() && mY == v.getY() && mZ == v.getZ() );
}

bool Vector3D::operator!=( const Vector3D& v )
bool Vector3D::operator!=( const Vector3D& v ) const
{
return ( !(( *this ) == v ) );
}
@@ -43,8 +43,8 @@ class ANALYSIS_EXPORT Vector3D
/** Destructor*/
~Vector3D();
Vector3D& operator=( const Vector3D& v );
bool operator==( const Vector3D& v );
bool operator!=( const Vector3D& v );
bool operator==( const Vector3D& v ) const;
bool operator!=( const Vector3D& v ) const;
/** Returns the x-component of the vector*/
double getX() const;
/** Returns the y-component of the vector*/
@@ -44,7 +44,7 @@ class QgsWelcomePageItemsModel : public QAbstractListModel

struct RecentProjectData
{
bool operator==( const RecentProjectData& other ) { return other.path == this->path; }
bool operator==( const RecentProjectData& other ) const { return other.path == this->path; }
QString path;
QString title;
QString previewImagePath;
@@ -55,7 +55,7 @@ QgsProjectVersion::QgsProjectVersion( const QString& string )

/** Boolean equal operator
*/
bool QgsProjectVersion::operator==( const QgsProjectVersion &other )
bool QgsProjectVersion::operator==( const QgsProjectVersion &other ) const
{
return (( mMajor == other.mMajor ) &&
( mMinor == other.mMinor ) &&
@@ -64,7 +64,7 @@ bool QgsProjectVersion::operator==( const QgsProjectVersion &other )

/** Boolean >= operator
*/
bool QgsProjectVersion::operator>=( const QgsProjectVersion &other )
bool QgsProjectVersion::operator>=( const QgsProjectVersion &other ) const
{
return (( mMajor >= other.mMajor ) ||
(( mMajor == other.mMajor ) && ( mMinor >= other.mMinor ) ) ||
@@ -73,7 +73,7 @@ bool QgsProjectVersion::operator>=( const QgsProjectVersion &other )

/** Boolean > operator
*/
bool QgsProjectVersion::operator>( const QgsProjectVersion &other )
bool QgsProjectVersion::operator>( const QgsProjectVersion &other ) const
{
return (( mMajor > other.mMajor ) ||
(( mMajor == other.mMajor ) && ( mMinor > other.mMinor ) ) ||
@@ -43,15 +43,15 @@ class CORE_EXPORT QgsProjectVersion

/** Boolean equal operator
*/
bool operator==( const QgsProjectVersion &other );
bool operator==( const QgsProjectVersion &other ) const;

/** Boolean >= operator
*/
bool operator>=( const QgsProjectVersion &other );
bool operator>=( const QgsProjectVersion &other ) const;

/** Boolean > operator
*/
bool operator>( const QgsProjectVersion &other );
bool operator>( const QgsProjectVersion &other ) const;

private:
int mMajor;

0 comments on commit 7842391

Please sign in to comment.
You can’t perform that action at this time.