From 3ec363004893faf725d5f1d002ee0297dd3ae689 Mon Sep 17 00:00:00 2001 From: Matthias Kollmann Date: Mon, 16 Oct 2017 17:06:05 +0200 Subject: [PATCH] made QZeroConfService compareable --- qzeroconfservice.cpp | 5 +++++ qzeroconfservice.h | 1 + 2 files changed, 6 insertions(+) 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;