diff --git a/qzeroconfservice.cpp b/qzeroconfservice.cpp index 48e8e29..4afdb6a 100644 --- a/qzeroconfservice.cpp +++ b/qzeroconfservice.cpp @@ -139,4 +139,9 @@ bool QZeroConfService::isValid() const return (!data->name.isEmpty()) && (data->port > 0); } +bool QZeroConfService::operator==(const QZeroConfService &rhs) const +{ + return this->name() == rhs.name() && this->ip() == rhs.ip() && this->ipv6() == rhs.ipv6(); +} + diff --git a/qzeroconfservice.h b/qzeroconfservice.h index 35241cc..a50ee2e 100644 --- a/qzeroconfservice.h +++ b/qzeroconfservice.h @@ -36,6 +36,7 @@ public: void appendTxt(QByteArray idx, QByteArray val = ""); bool isValid() const; + bool operator==(const QZeroConfService &rhs) const; private: QSharedDataPointer data;