Skip to content

Commit

Permalink
Add some missing consts to operators
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 27, 2015
1 parent fe221d5 commit 7842391
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions python/analysis/interpolation/Point3D.sip
Expand Up @@ -10,8 +10,8 @@ class Point3D
Point3D( const Point3D& p ); Point3D( const Point3D& p );
~Point3D(); ~Point3D();
// Point3D& operator=( const Point3D& p ); // Point3D& operator=( const Point3D& p );
bool operator==( const Point3D& p ); bool operator==( const Point3D& p ) const;
bool operator!=( const Point3D& p ); bool operator!=( const Point3D& p ) const;
/** Calculates the three-dimensional distance to another point*/ /** Calculates the three-dimensional distance to another point*/
double dist3D( Point3D* p ) const; double dist3D( Point3D* p ) const;
/** Returns the x-coordinate of the point*/ /** Returns the x-coordinate of the point*/
Expand Down
4 changes: 2 additions & 2 deletions python/analysis/interpolation/Vector3D.sip
Expand Up @@ -14,8 +14,8 @@ class Vector3D
/** Destructor*/ /** Destructor*/
~Vector3D(); ~Vector3D();
// Vector3D& operator=( const Vector3D& v ); // Vector3D& operator=( const Vector3D& v );
bool operator==( const Vector3D& v ); bool operator==( const Vector3D& v ) const;
bool operator!=( const Vector3D& v ); bool operator!=( const Vector3D& v ) const;
/** Returns the x-component of the vector*/ /** Returns the x-component of the vector*/
double getX() const; double getX() const;
/** Returns the y-component of the vector*/ /** Returns the y-component of the vector*/
Expand Down
6 changes: 3 additions & 3 deletions python/core/qgsprojectversion.sip
Expand Up @@ -23,15 +23,15 @@ class QgsProjectVersion


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


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


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


}; };


4 changes: 2 additions & 2 deletions src/analysis/interpolation/Point3D.cc
Expand Up @@ -25,12 +25,12 @@ Point3D& Point3D::operator=( const Point3D & p )
return ( *this ); 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() ); 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 ) ); return ( !(( *this ) == p ) );
} }
Expand Down
4 changes: 2 additions & 2 deletions src/analysis/interpolation/Point3D.h
Expand Up @@ -36,8 +36,8 @@ class ANALYSIS_EXPORT Point3D
Point3D( const Point3D& p ); Point3D( const Point3D& p );
~Point3D(); ~Point3D();
Point3D& operator=( const Point3D& p ); Point3D& operator=( const Point3D& p );
bool operator==( const Point3D& p ); bool operator==( const Point3D& p ) const;
bool operator!=( const Point3D& p ); bool operator!=( const Point3D& p ) const;
/** Calculates the three-dimensional distance to another point*/ /** Calculates the three-dimensional distance to another point*/
double dist3D( Point3D* p ) const; double dist3D( Point3D* p ) const;
/** Returns the x-coordinate of the point*/ /** Returns the x-coordinate of the point*/
Expand Down
4 changes: 2 additions & 2 deletions src/analysis/interpolation/Vector3D.cc
Expand Up @@ -37,12 +37,12 @@ Vector3D& Vector3D::operator=( const Vector3D & v )
return ( *this ); 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() ); 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 ) ); return ( !(( *this ) == v ) );
} }
4 changes: 2 additions & 2 deletions src/analysis/interpolation/Vector3D.h
Expand Up @@ -43,8 +43,8 @@ class ANALYSIS_EXPORT Vector3D
/** Destructor*/ /** Destructor*/
~Vector3D(); ~Vector3D();
Vector3D& operator=( const Vector3D& v ); Vector3D& operator=( const Vector3D& v );
bool operator==( const Vector3D& v ); bool operator==( const Vector3D& v ) const;
bool operator!=( const Vector3D& v ); bool operator!=( const Vector3D& v ) const;
/** Returns the x-component of the vector*/ /** Returns the x-component of the vector*/
double getX() const; double getX() const;
/** Returns the y-component of the vector*/ /** Returns the y-component of the vector*/
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgswelcomepageitemsmodel.h
Expand Up @@ -44,7 +44,7 @@ class QgsWelcomePageItemsModel : public QAbstractListModel


struct RecentProjectData 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 path;
QString title; QString title;
QString previewImagePath; QString previewImagePath;
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsprojectversion.cpp
Expand Up @@ -55,7 +55,7 @@ QgsProjectVersion::QgsProjectVersion( const QString& string )


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


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


/** Boolean > operator /** Boolean > operator
*/ */
bool QgsProjectVersion::operator>( const QgsProjectVersion &other ) bool QgsProjectVersion::operator>( const QgsProjectVersion &other ) const
{ {
return (( mMajor > other.mMajor ) || return (( mMajor > other.mMajor ) ||
(( mMajor == other.mMajor ) && ( mMinor > other.mMinor ) ) || (( mMajor == other.mMajor ) && ( mMinor > other.mMinor ) ) ||
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsprojectversion.h
Expand Up @@ -43,15 +43,15 @@ class CORE_EXPORT QgsProjectVersion


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


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


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


private: private:
int mMajor; int mMajor;
Expand Down

0 comments on commit 7842391

Please sign in to comment.