OSDN Git Service

QmlDesigner.model: adding early reject to reparentHere()
authorThomas Hartmann <Thomas.Hartmann@nokia.com>
Mon, 20 Dec 2010 13:32:12 +0000 (14:32 +0100)
committerThomas Hartmann <Thomas.Hartmann@nokia.com>
Mon, 20 Dec 2010 13:32:12 +0000 (14:32 +0100)
If this property is already the parent node,
then there is nothing to do.

src/plugins/qmldesigner/designercore/model/nodeabstractproperty.cpp

index c756319..4694695 100644 (file)
@@ -72,6 +72,8 @@ void NodeAbstractProperty::reparentHere(const ModelNode &modelNode)
 
 void NodeAbstractProperty::reparentHere(const ModelNode &modelNode,  bool isNodeList)
 {
+    if (modelNode.parentProperty() == *this)
+        return;
     Internal::WriteLocker locker(model());
     if (!isValid())
         throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);