From 4e2ae6954c20b0b7e3a9845d2331e68695153726 Mon Sep 17 00:00:00 2001 From: 0xd34df00d <0xd34df00d@gmail.com> Date: Wed, 23 Apr 2014 16:48:18 +0400 Subject: Added operator== and != for QXmppVCardAddress. --- src/base/QXmppVCardIq.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/base/QXmppVCardIq.cpp') diff --git a/src/base/QXmppVCardIq.cpp b/src/base/QXmppVCardIq.cpp index 6d9f1fdb..7701b60a 100644 --- a/src/base/QXmppVCardIq.cpp +++ b/src/base/QXmppVCardIq.cpp @@ -86,6 +86,23 @@ QXmppVCardAddress& QXmppVCardAddress::operator=(const QXmppVCardAddress &other) return *this; } +/// \brief Checks if two address objects represent the same address. + +bool operator==(const QXmppVCardAddress &left, const QXmppVCardAddress &right) +{ + return left.type() == right.type() && + left.country() == right.country() && + left.locality() == right.locality() && + left.postcode() == right.postcode() && + left.region() == right.region() && + left.street() == right.street(); +} + +bool operator!=(const QXmppVCardAddress &left, const QXmppVCardAddress &right) +{ + return !(left == right); +} + /// Returns the country. QString QXmppVCardAddress::country() const -- cgit v1.2.3