From 237d173160ca3f95d36a9e16784058edbdfe84fa Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Mon, 29 Jul 2013 17:20:47 +0200 Subject: [PATCH] QmlDesigner: Rename instanceForNode in instanceForModelNode Change-Id: I182d5b557f5770816059897e746709d054ecac51 Reviewed-by: Thomas Hartmann --- .../designercore/include/nodeinstanceview.h | 2 +- .../instances/nodeinstanceview.cpp | 46 +++++++++---------- .../designercore/model/qmlmodelnodefacade.cpp | 2 +- .../designercore/model/qmlobjectnode.cpp | 4 +- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/plugins/qmldesigner/designercore/include/nodeinstanceview.h b/src/plugins/qmldesigner/designercore/include/nodeinstanceview.h index 2b7ef3180ca..5674d13c22e 100644 --- a/src/plugins/qmldesigner/designercore/include/nodeinstanceview.h +++ b/src/plugins/qmldesigner/designercore/include/nodeinstanceview.h @@ -122,7 +122,7 @@ public: void actualStateChanged(const ModelNode &node); QList instances() const; - NodeInstance instanceForNode(const ModelNode &node) const ; + NodeInstance instanceForModelNode(const ModelNode &node) const ; bool hasInstanceForNode(const ModelNode &node) const; NodeInstance instanceForId(qint32 id); diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp index 6e76c66cff3..ecbfd3a7c8a 100644 --- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp +++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp @@ -161,7 +161,7 @@ void NodeInstanceView::modelAttached(Model *model) ModelNode stateNode = actualStateNode(); if (stateNode.isValid() && stateNode.metaInfo().isSubclassOf("QtQuick.State", 1, 0)) { - NodeInstance newStateInstance = instanceForNode(stateNode); + NodeInstance newStateInstance = instanceForModelNode(stateNode); activateState(newStateInstance); } @@ -205,7 +205,7 @@ void NodeInstanceView::restartProcess() ModelNode stateNode = actualStateNode(); if (stateNode.isValid() && stateNode.metaInfo().isSubclassOf("QtQuick.State", 1, 0)) { - NodeInstance newStateInstance = instanceForNode(stateNode); + NodeInstance newStateInstance = instanceForModelNode(stateNode); activateState(newStateInstance); } } @@ -404,7 +404,7 @@ void NodeInstanceView::fileUrlChanged(const QUrl &/*oldUrl*/, const QUrl &newUrl void NodeInstanceView::nodeIdChanged(const ModelNode& node, const QString& /*newId*/, const QString& /*oldId*/) { if (hasInstanceForNode(node)) { - NodeInstance instance = instanceForNode(node); + NodeInstance instance = instanceForModelNode(node); nodeInstanceServer()->changeIds(createChangeIdsCommand(QList() << instance)); } } @@ -417,12 +417,12 @@ void NodeInstanceView::nodeOrderChanged(const NodeListProperty & listProperty, qint32 containerInstanceId = -1; ModelNode containerNode = listProperty.parentModelNode(); if (hasInstanceForNode(containerNode)) - containerInstanceId = instanceForNode(containerNode).instanceId(); + containerInstanceId = instanceForModelNode(containerNode).instanceId(); foreach (const ModelNode &node, listProperty.toModelNodeList()) { qint32 instanceId = -1; if (hasInstanceForNode(node)) { - instanceId = instanceForNode(node).instanceId(); + instanceId = instanceForModelNode(node).instanceId(); ReparentContainer container(instanceId, containerInstanceId, propertyName, containerInstanceId, propertyName); containerList.append(container); } @@ -493,7 +493,7 @@ void NodeInstanceView::auxiliaryDataChanged(const ModelNode &node, const Propert { if ((node.isRootNode() && (name == "width" || name == "height")) || name.endsWith(PropertyName("@NodeInstance"))) { if (hasInstanceForNode(node)) { - NodeInstance instance = instanceForNode(node); + NodeInstance instance = instanceForModelNode(node); QVariant value = data; if (value.isValid()) { PropertyValueContainer container(instance.instanceId(), name, value, TypeName()); @@ -523,7 +523,7 @@ void NodeInstanceView::customNotification(const AbstractView *view, const QStrin void NodeInstanceView::nodeSourceChanged(const ModelNode &node, const QString & newNodeSource) { if (hasInstanceForNode(node)) { - NodeInstance instance = instanceForNode(node); + NodeInstance instance = instanceForModelNode(node); ChangeNodeSourceCommand changeNodeSourceCommand(instance.instanceId(), newNodeSource); nodeInstanceServer()->changeNodeSource(changeNodeSourceCommand); } @@ -541,7 +541,7 @@ void NodeInstanceView::rewriterEndTransaction() void NodeInstanceView::actualStateChanged(const ModelNode &node) { - NodeInstance newStateInstance = instanceForNode(node); + NodeInstance newStateInstance = instanceForModelNode(node); if (newStateInstance.isValid() && node.metaInfo().isSubclassOf("QtQuick.State", 1, 0)) nodeInstanceView()->activateState(newStateInstance); @@ -576,7 +576,7 @@ QList NodeInstanceView::instances() const \returns NodeStance for ModelNode. \see NodeInstance */ -NodeInstance NodeInstanceView::instanceForNode(const ModelNode &node) const +NodeInstance NodeInstanceView::instanceForModelNode(const ModelNode &node) const { Q_ASSERT(node.isValid()); Q_ASSERT(m_nodeInstanceHash.contains(node)); @@ -657,7 +657,7 @@ void NodeInstanceView::insertInstanceRelationships(const NodeInstance &instance) void NodeInstanceView::removeInstanceNodeRelationship(const ModelNode &node) { Q_ASSERT(m_nodeInstanceHash.contains(node)); - NodeInstance instance = instanceForNode(node); + NodeInstance instance = instanceForModelNode(node); m_nodeInstanceHash.remove(node); instance.makeInvalid(); } @@ -759,7 +759,7 @@ CreateSceneCommand NodeInstanceView::createCreateSceneCommand() variantPropertyList.append(node.variantProperties()); bindingPropertyList.append(node.bindingProperties()); if (node.isValid() && hasInstanceForNode(node)) { - NodeInstance instance = instanceForNode(node); + NodeInstance instance = instanceForModelNode(node); QHashIterator auxiliaryIterator(node.auxiliaryData()); while (auxiliaryIterator.hasNext()) { auxiliaryIterator.next(); @@ -795,7 +795,7 @@ CreateSceneCommand NodeInstanceView::createCreateSceneCommand() foreach (const NodeInstance &instance, instanceList) { if (instance.modelNode().hasParentProperty()) { NodeAbstractProperty parentProperty = instance.modelNode().parentProperty(); - ReparentContainer container(instance.instanceId(), -1, PropertyName(), instanceForNode(parentProperty.parentModelNode()).instanceId(), parentProperty.name()); + ReparentContainer container(instance.instanceId(), -1, PropertyName(), instanceForModelNode(parentProperty.parentModelNode()).instanceId(), parentProperty.name()); reparentContainerList.append(container); } } @@ -813,7 +813,7 @@ CreateSceneCommand NodeInstanceView::createCreateSceneCommand() foreach (const VariantProperty &property, variantPropertyList) { ModelNode node = property.parentModelNode(); if (node.isValid() && hasInstanceForNode(node)) { - NodeInstance instance = instanceForNode(node); + NodeInstance instance = instanceForModelNode(node); PropertyValueContainer container(instance.instanceId(), property.name(), property.value(), property.dynamicTypeName()); valueContainerList.append(container); } @@ -823,7 +823,7 @@ CreateSceneCommand NodeInstanceView::createCreateSceneCommand() foreach (const BindingProperty &property, bindingPropertyList) { ModelNode node = property.parentModelNode(); if (node.isValid() && hasInstanceForNode(node)) { - NodeInstance instance = instanceForNode(node); + NodeInstance instance = instanceForModelNode(node); PropertyBindingContainer container(instance.instanceId(), property.name(), property.expression(), property.dynamicTypeName()); bindingContainerList.append(container); } @@ -894,7 +894,7 @@ ReparentInstancesCommand NodeInstanceView::createReparentInstancesCommand(const foreach (const NodeInstance &instance, instanceList) { if (instance.modelNode().hasParentProperty()) { NodeAbstractProperty parentProperty = instance.modelNode().parentProperty(); - ReparentContainer container(instance.instanceId(), -1, PropertyName(), instanceForNode(parentProperty.parentModelNode()).instanceId(), parentProperty.name()); + ReparentContainer container(instance.instanceId(), -1, PropertyName(), instanceForModelNode(parentProperty.parentModelNode()).instanceId(), parentProperty.name()); containerList.append(container); } } @@ -910,14 +910,14 @@ ReparentInstancesCommand NodeInstanceView::createReparentInstancesCommand(const qint32 oldParentInstanceId = -1; if (newPropertyParent.isValid() && hasInstanceForNode(newPropertyParent.parentModelNode())) - newParentInstanceId = instanceForNode(newPropertyParent.parentModelNode()).instanceId(); + newParentInstanceId = instanceForModelNode(newPropertyParent.parentModelNode()).instanceId(); if (oldPropertyParent.isValid() && hasInstanceForNode(oldPropertyParent.parentModelNode())) - oldParentInstanceId = instanceForNode(oldPropertyParent.parentModelNode()).instanceId(); + oldParentInstanceId = instanceForModelNode(oldPropertyParent.parentModelNode()).instanceId(); - ReparentContainer container(instanceForNode(node).instanceId(), oldParentInstanceId, oldPropertyParent.name(), newParentInstanceId, newPropertyParent.name()); + ReparentContainer container(instanceForModelNode(node).instanceId(), oldParentInstanceId, oldPropertyParent.name(), newParentInstanceId, newPropertyParent.name()); containerList.append(container); @@ -936,7 +936,7 @@ ChangeValuesCommand NodeInstanceView::createChangeValueCommand(const QList idList; foreach (const ModelNode &node, nodeList) { if (node.isValid() && hasInstanceForNode(node)) { - NodeInstance instance = instanceForNode(node); + NodeInstance instance = instanceForModelNode(node); if (instance.instanceId() >= 0) idList.append(instance.instanceId()); @@ -999,7 +999,7 @@ RemoveInstancesCommand NodeInstanceView::createRemoveInstancesCommand(const Mode QVector idList; if (node.isValid() && hasInstanceForNode(node)) - idList.append(instanceForNode(node).instanceId()); + idList.append(instanceForModelNode(node).instanceId()); return RemoveInstancesCommand(idList); } @@ -1011,7 +1011,7 @@ RemovePropertiesCommand NodeInstanceView::createRemovePropertiesCommand(const QL foreach (const AbstractProperty &property, propertyList) { ModelNode node = property.parentModelNode(); if (node.isValid() && hasInstanceForNode(node)) { - NodeInstance instance = instanceForNode(node); + NodeInstance instance = instanceForModelNode(node); PropertyAbstractContainer container(instance.instanceId(), property.name(), property.dynamicTypeName()); containerList.append(container); } diff --git a/src/plugins/qmldesigner/designercore/model/qmlmodelnodefacade.cpp b/src/plugins/qmldesigner/designercore/model/qmlmodelnodefacade.cpp index 4b3480a0ae1..53c0cd71a8a 100644 --- a/src/plugins/qmldesigner/designercore/model/qmlmodelnodefacade.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmlmodelnodefacade.cpp @@ -74,7 +74,7 @@ bool QmlModelNodeFacade::isValidQmlModelNodeFacade(const ModelNode &modelNode) && qmlModelView() && qmlModelView()->nodeInstanceView() && qmlModelView()->nodeInstanceView()->hasInstanceForNode(modelNode) - && qmlModelView()->nodeInstanceView()->instanceForNode(modelNode).isValid(); + && qmlModelView()->nodeInstanceView()->instanceForModelNode(modelNode).isValid(); } bool QmlModelNodeFacade::isRootNode() const diff --git a/src/plugins/qmldesigner/designercore/model/qmlobjectnode.cpp b/src/plugins/qmldesigner/designercore/model/qmlobjectnode.cpp index 1a8dd6ecc11..57f832c22fc 100644 --- a/src/plugins/qmldesigner/designercore/model/qmlobjectnode.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmlobjectnode.cpp @@ -404,7 +404,7 @@ bool QmlObjectNode::isAncestorOf(const QmlObjectNode &objectNode) const QVariant QmlObjectNode::instanceValue(const ModelNode &modelNode, const PropertyName &name) { Q_ASSERT(modelNode.view()->nodeInstanceView()->hasInstanceForNode(modelNode)); - return modelNode.view()->nodeInstanceView()->instanceForNode(modelNode).property(name); + return modelNode.view()->nodeInstanceView()->instanceForModelNode(modelNode).property(name); } QString QmlObjectNode::generateTranslatableText(const QString &text) @@ -428,7 +428,7 @@ bool QmlObjectNode::instanceHasBinding(const PropertyName &name) const NodeInstance QmlObjectNode::nodeInstance() const { - return qmlModelView()->nodeInstanceView()->instanceForNode(modelNode()); + return qmlModelView()->nodeInstanceView()->instanceForModelNode(modelNode()); } QmlObjectNode QmlObjectNode::nodeForInstance(const NodeInstance &instance) const