aboutsummaryrefslogtreecommitdiff
path: root/src/base
diff options
context:
space:
mode:
Diffstat (limited to 'src/base')
-rw-r--r--src/base/QXmppVCardIq.cpp17
-rw-r--r--src/base/QXmppVCardIq.h3
2 files changed, 20 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
diff --git a/src/base/QXmppVCardIq.h b/src/base/QXmppVCardIq.h
index cb54b91d..ae0e7efc 100644
--- a/src/base/QXmppVCardIq.h
+++ b/src/base/QXmppVCardIq.h
@@ -84,6 +84,9 @@ private:
QSharedDataPointer<QXmppVCardAddressPrivate> d;
};
+QXMPP_EXPORT bool operator==(const QXmppVCardAddress&, const QXmppVCardAddress&);
+QXMPP_EXPORT bool operator!=(const QXmppVCardAddress&, const QXmppVCardAddress&);
+
/// \brief Represents a vCard e-mail address.
class QXMPP_EXPORT QXmppVCardEmail