aboutsummaryrefslogtreecommitdiff
path: root/src/base/QXmppVCardIq.cpp
diff options
context:
space:
mode:
author0xd34df00d <0xd34df00d@gmail.com>2014-04-23 16:48:18 +0400
committer0xd34df00d <0xd34df00d@gmail.com>2014-04-23 16:48:18 +0400
commit4e2ae6954c20b0b7e3a9845d2331e68695153726 (patch)
treea9a7843362dc082e3e5d6f97926a5a2de5bcd248 /src/base/QXmppVCardIq.cpp
parentc94d62a1df697b2ab7701f89c1aaa9b4c981ad0f (diff)
downloadqxmpp-4e2ae6954c20b0b7e3a9845d2331e68695153726.tar.gz
Added operator== and != for QXmppVCardAddress.
Diffstat (limited to 'src/base/QXmppVCardIq.cpp')
-rw-r--r--src/base/QXmppVCardIq.cpp17
1 files changed, 17 insertions, 0 deletions
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