diff --git a/GUI/Model/Descriptor/ComboProperty.cpp b/GUI/Model/Descriptor/ComboProperty.cpp index cb17abc200025f9d58c34a78ecb5163b645478a6..8ce95d9db5e121d6b36333224615da855ebaa301 100644 --- a/GUI/Model/Descriptor/ComboProperty.cpp +++ b/GUI/Model/Descriptor/ComboProperty.cpp @@ -107,26 +107,6 @@ ComboProperty& ComboProperty::operator<<(const QStringList& str) return *this; } -bool ComboProperty::operator==(const ComboProperty& other) const -{ - if (m_selected_indices != other.m_selected_indices) - return false; - if (m_values != other.m_values) - return false; - return true; -} - -bool ComboProperty::operator!=(const ComboProperty& other) const -{ - return !(*this == other); -} - -bool ComboProperty::operator<(const ComboProperty& other) const -{ - return m_selected_indices.size() < other.m_selected_indices.size() - && m_values.size() < other.m_values.size(); -} - //! Constructs variant enclosing given ComboProperty. QVariant ComboProperty::variant() const diff --git a/GUI/Model/Descriptor/ComboProperty.h b/GUI/Model/Descriptor/ComboProperty.h index b242eec229b9d6c9da8407e7f36d3b4d82814147..7b3183dbfd30552b2ac7ffdc4cd626c315c8c129 100644 --- a/GUI/Model/Descriptor/ComboProperty.h +++ b/GUI/Model/Descriptor/ComboProperty.h @@ -45,9 +45,6 @@ public: ComboProperty& operator<<(const QString& str); ComboProperty& operator<<(const QStringList& str); - bool operator==(const ComboProperty& other) const; - bool operator!=(const ComboProperty& other) const; - bool operator<(const ComboProperty& other) const; QVariant variant() const; diff --git a/Tests/Unit/GUI/TestComboProperty.cpp b/Tests/Unit/GUI/TestComboProperty.cpp index b262ec22a179c7032d01bcd7d8edb78d627492e3..375b0244809b3063f809049a2e7dc3d1003844b4 100644 --- a/Tests/Unit/GUI/TestComboProperty.cpp +++ b/Tests/Unit/GUI/TestComboProperty.cpp @@ -85,68 +85,3 @@ TEST_F(TestComboProperty, setCurrentIndex) combo.setCurrentIndex(0); EXPECT_EQ(combo.currentValue(), "c1"); } -TEST_F(TestComboProperty, comboEquality) -{ - ComboProperty c1; - ComboProperty c2; - EXPECT_TRUE(c1 == c2); - - c1 << "a1" - << "a2"; - c2 << "a1" - << "a2"; - EXPECT_TRUE(c1 == c2); - EXPECT_FALSE(c1 != c2); - - c2 << "a3"; - EXPECT_TRUE(c1 != c2); - EXPECT_FALSE(c1 == c2); - c2.setCurrentValue("a2"); - EXPECT_TRUE(c1 != c2); - EXPECT_FALSE(c1 == c2); - - c1 << "a3"; - c1.setCurrentValue("a2"); - EXPECT_TRUE(c1 == c2); - EXPECT_FALSE(c1 != c2); - - // with selection indices - c1 = ComboProperty() << "a1" - << "a2" - << "a3"; - c2 = ComboProperty() << "a1" - << "a2" - << "a3"; - EXPECT_TRUE(c1 == c2); - - c2.setSelected(0, false); - c2.setSelected(2, true); - EXPECT_TRUE(c1 != c2); -} - -//! Check equality of ComboPeroperty's variants. -//! If comparators are not registered, the behavior is undefined. - -TEST_F(TestComboProperty, variantEquality) -{ - ComboProperty c1 = ComboProperty() << "a1" - << "a2"; - ComboProperty c2 = ComboProperty() << "a1" - << "a2"; - - if (Comparators::registered()) { - EXPECT_TRUE(c1.variant() == c2.variant()); - - c2 << "a3"; - c2.setCurrentValue("a2"); - - EXPECT_TRUE(c1.variant() != c2.variant()); - EXPECT_FALSE(c1.variant() == c2.variant()); - - c1 << "a3"; - c1.setCurrentValue("a2"); - - EXPECT_TRUE(c1.variant() == c2.variant()); - EXPECT_FALSE(c1.variant() != c2.variant()); - } -}