diff options
author | kh1 <karsten.heimrich@nokia.com> | 2012-01-17 14:56:17 +0100 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@nokia.com> | 2012-01-17 16:19:16 +0100 |
commit | 47bc2f470f6609666d31116c2774cd191091a0bc (patch) | |
tree | 6cf3ac3c922747698055e01f1204f2a9a8906e1f /installerbuilder/common | |
parent | c438349dea76da00d9fd5f986884f9115f0b4343 (diff) |
Implement operator!=().
Change-Id: I7584bf90b3b419932c6c68d80924a459e6b5e8d1
Reviewed-by: Alexander Lenhardt <alexander.lenhardt@nokia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
Diffstat (limited to 'installerbuilder/common')
-rw-r--r-- | installerbuilder/common/repository.cpp | 13 | ||||
-rw-r--r-- | installerbuilder/common/repository.h | 4 |
2 files changed, 14 insertions, 3 deletions
diff --git a/installerbuilder/common/repository.cpp b/installerbuilder/common/repository.cpp index cb22a746b..dfcfdb756 100644 --- a/installerbuilder/common/repository.cpp +++ b/installerbuilder/common/repository.cpp @@ -152,8 +152,8 @@ void Repository::setPassword(const QString &password) } /*! - Compares the value of this repository to \a other and returns true if they are equal (same server, - default state, enabled state as well as username and password). + Compares the values of this repository to \a other and returns true if they are equal (same server, + default state, enabled state as well as username and password). \sa operator!=() */ bool Repository::operator==(const Repository &other) const { @@ -162,6 +162,15 @@ bool Repository::operator==(const Repository &other) const } /*! + Returns true if the \a other repository is not equal to this repository; otherwise returns false. Two + repositories are considered equal if they contain the same elements. \sa operator==() +*/ +bool Repository::operator!=(const Repository &other) const +{ + return !(*this == other); +} + +/*! Assigns the values of repository \a other to this repository. */ const Repository &Repository::operator=(const Repository &other) diff --git a/installerbuilder/common/repository.h b/installerbuilder/common/repository.h index 8438df20b..9110725ad 100644 --- a/installerbuilder/common/repository.h +++ b/installerbuilder/common/repository.h @@ -61,8 +61,10 @@ public: QString password() const; void setPassword(const QString &password); - uint qHash(const Repository &repository); bool operator==(const Repository &other) const; + bool operator!=(const Repository &other) const; + + uint qHash(const Repository &repository); const Repository &operator=(const Repository &other); friend QDataStream &operator>>(QDataStream &istream, Repository &repository); |