Check for C++ operators that should be 'const'
Make sure all C++ class comparison operators are const. Change-Id: Ib4a66f2afe6c62f437dae1ecde94287d3db8442d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: David Faure <faure@kde.org>
This commit is contained in:
parent
afb0260f50
commit
ce8e6abe7f
@ -63,10 +63,10 @@ public:
|
||||
inline const QString &real() const { return real_name; }
|
||||
const QString &local() const;
|
||||
|
||||
bool operator==(const QMakeLocalFileName &other) {
|
||||
bool operator==(const QMakeLocalFileName &other) const {
|
||||
return (this->real_name == other.real_name);
|
||||
}
|
||||
bool operator!=(const QMakeLocalFileName &other) {
|
||||
bool operator!=(const QMakeLocalFileName &other) const {
|
||||
return !(*this == other);
|
||||
}
|
||||
};
|
||||
|
@ -67,7 +67,7 @@ QMimeMagicRuleMatcher::QMimeMagicRuleMatcher(const QString &mime, unsigned thePr
|
||||
{
|
||||
}
|
||||
|
||||
bool QMimeMagicRuleMatcher::operator==(const QMimeMagicRuleMatcher &other)
|
||||
bool QMimeMagicRuleMatcher::operator==(const QMimeMagicRuleMatcher &other) const
|
||||
{
|
||||
return m_list == other.m_list &&
|
||||
m_priority == other.m_priority;
|
||||
|
@ -55,7 +55,7 @@ class QMimeMagicRuleMatcher
|
||||
public:
|
||||
explicit QMimeMagicRuleMatcher(const QString &mime, unsigned priority = 65535);
|
||||
|
||||
bool operator==(const QMimeMagicRuleMatcher &other);
|
||||
bool operator==(const QMimeMagicRuleMatcher &other) const;
|
||||
|
||||
void addRule(const QMimeMagicRule &rule);
|
||||
void addRules(const QList<QMimeMagicRule> &rules);
|
||||
|
@ -399,7 +399,7 @@ public:
|
||||
bool useOpacityAttribute;
|
||||
bool usePmvMatrixAttribute;
|
||||
|
||||
bool operator==(const QOpenGLEngineShaderProg& other) {
|
||||
bool operator==(const QOpenGLEngineShaderProg& other) const {
|
||||
// We don't care about the program
|
||||
return ( mainVertexShader == other.mainVertexShader &&
|
||||
positionVertexShader == other.positionVertexShader &&
|
||||
|
@ -121,7 +121,7 @@ QSqlError& QSqlError::operator=(const QSqlError& other)
|
||||
Compare the \a other error's values to this error and returns true, if it equal.
|
||||
*/
|
||||
|
||||
bool QSqlError::operator==(const QSqlError& other)
|
||||
bool QSqlError::operator==(const QSqlError& other) const
|
||||
{
|
||||
return (errorType == other.errorType);
|
||||
}
|
||||
@ -131,7 +131,7 @@ bool QSqlError::operator==(const QSqlError& other)
|
||||
Compare the \a other error's values to this error and returns true if it is not equal.
|
||||
*/
|
||||
|
||||
bool QSqlError::operator!=(const QSqlError& other)
|
||||
bool QSqlError::operator!=(const QSqlError& other) const
|
||||
{
|
||||
return (errorType != other.errorType);
|
||||
}
|
||||
|
@ -66,8 +66,8 @@ public:
|
||||
int number = -1);
|
||||
QSqlError(const QSqlError& other);
|
||||
QSqlError& operator=(const QSqlError& other);
|
||||
bool operator==(const QSqlError& other);
|
||||
bool operator!=(const QSqlError& other);
|
||||
bool operator==(const QSqlError& other) const;
|
||||
bool operator!=(const QSqlError& other) const;
|
||||
~QSqlError();
|
||||
|
||||
QString driverText() const;
|
||||
|
Loading…
Reference in New Issue
Block a user