Commit 236d7c09 authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner: Do not throw in comparison operators

It is unexpected and not required at all, since
the operators are well defined for invalid nodes.

Change-Id: I56841a21b8ba814fc2996485084584d9b4b521c2
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent ceb9533f
......@@ -730,11 +730,6 @@ void ModelNode::destroy()
*/
bool operator ==(const ModelNode &firstNode, const ModelNode &secondNode)
{
if (firstNode.m_internalNode.isNull() || secondNode.m_internalNode.isNull()) {
Q_ASSERT_X(0, Q_FUNC_INFO, "model node is invalid");
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
}
return firstNode.internalId() == secondNode.internalId();
}
......@@ -743,21 +738,11 @@ bool operator ==(const ModelNode &firstNode, const ModelNode &secondNode)
*/
bool operator !=(const ModelNode &firstNode, const ModelNode &secondNode)
{
if (firstNode.m_internalNode.isNull() || secondNode.m_internalNode.isNull()) {
Q_ASSERT_X(0, Q_FUNC_INFO, "model node is invalid");
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
}
return firstNode.internalId() != secondNode.internalId();
}
bool operator <(const ModelNode &firstNode, const ModelNode &secondNode)
{
if (firstNode.m_internalNode.isNull() || secondNode.m_internalNode.isNull()) {
Q_ASSERT_X(0, Q_FUNC_INFO, "model node is invalid");
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
}
return firstNode.internalId() < secondNode.internalId();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment