From 7f8597a62c83e59a7bac4bbd7ff10d00e4b1ecfe Mon Sep 17 00:00:00 2001 From: Jari Jarvi Date: Tue, 29 Jun 2010 11:54:41 +0300 Subject: [PATCH] operator== for Remote --- src/remote.cpp | 8 ++++++++ src/remote.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/remote.cpp b/src/remote.cpp index 1f41978..8795c9a 100644 --- a/src/remote.cpp +++ b/src/remote.cpp @@ -62,6 +62,14 @@ Remote &Remote::operator=(const Remote &other) return *this; } +bool Remote::operator==(const Remote &other) const +{ + return (m_name == other.m_name && + m_mfg == other.m_mfg && + m_rating == other.m_rating && + m_voteCount == other.m_voteCount); +} + void Remote::saveToFile() { if (!m_name.isEmpty()) { diff --git a/src/remote.h b/src/remote.h index 5adcabd..3f21cee 100644 --- a/src/remote.h +++ b/src/remote.h @@ -20,6 +20,7 @@ public: int rating = 0, int voteCount = 0); Remote(const Remote &); Remote &operator=(const Remote &); + bool operator==(const Remote &other) const; ~Remote(); //getters -- 1.7.9.5