operator== for Remote
authorJari Jarvi <t7jaja00@students.oamk.fi>
Tue, 29 Jun 2010 08:54:41 +0000 (11:54 +0300)
committerJari Jarvi <t7jaja00@students.oamk.fi>
Tue, 29 Jun 2010 08:54:41 +0000 (11:54 +0300)
src/remote.cpp
src/remote.h

index 1f41978..8795c9a 100644 (file)
@@ -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()) {
index 5adcabd..3f21cee 100644 (file)
@@ -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