Commit 0b2451c4 authored by Marco Bubke's avatar Marco Bubke
Browse files

QmlDesigner.NodeInstances: Improve skip list

parent ec834c57
......@@ -189,10 +189,11 @@ bool isSkippedNode(const ModelNode &node)
void NodeInstanceView::nodeCreated(const ModelNode &createdNode)
{
NodeInstance instance = loadNode(createdNode);
if (isSkippedNode(createdNode))
return;
NodeInstance instance = loadNode(createdNode);
nodeInstanceServer()->createInstances(createCreateInstancesCommand(QList<NodeInstance>() << instance));
nodeInstanceServer()->changePropertyValues(createChangeValueCommand(createdNode.variantProperties()));
nodeInstanceServer()->completeComponent(createComponentCompleteCommand(QList<NodeInstance>() << instance));
......@@ -360,15 +361,8 @@ void NodeInstanceView::variantPropertiesChanged(const QList<VariantProperty>& pr
void NodeInstanceView::nodeReparented(const ModelNode &node, const NodeAbstractProperty &newPropertyParent, const NodeAbstractProperty &oldPropertyParent, AbstractView::PropertyChangeFlags /*propertyChange*/)
{
nodeInstanceServer()->reparentInstances(createReparentInstancesCommand(node, newPropertyParent, oldPropertyParent));
// NodeInstance nodeInstance(instanceForNode(node));
// NodeInstance oldParentInstance;
// if (hasInstanceForNode(oldPropertyParent.parentModelNode()))
// oldParentInstance = instanceForNode(oldPropertyParent.parentModelNode());
// NodeInstance newParentInstance;
// if (hasInstanceForNode(newPropertyParent.parentModelNode()))
// newParentInstance = instanceForNode(newPropertyParent.parentModelNode());
// nodeInstance.reparent(oldParentInstance, oldPropertyParent.name(), newParentInstance, newPropertyParent.name());
if (!isSkippedNode(node))
nodeInstanceServer()->reparentInstances(createReparentInstancesCommand(node, newPropertyParent, oldPropertyParent));
}
void NodeInstanceView::nodeAboutToBeReparented(const ModelNode &/*node*/, const NodeAbstractProperty &/*newPropertyParent*/, const NodeAbstractProperty &/*oldPropertyParent*/, AbstractView::PropertyChangeFlags /*propertyChange*/)
......@@ -378,10 +372,6 @@ void NodeInstanceView::nodeAboutToBeReparented(const ModelNode &/*node*/, const
void NodeInstanceView::fileUrlChanged(const QUrl &/*oldUrl*/, const QUrl &newUrl)
{
// TODO: We have to probably reload everything, so that images etc are updated!!!
//engine()->setBaseUrl(model()->fileUrl());
//TODO reload the whole scene
nodeInstanceServer()->changeFileUrl(createChangeFileUrlCommand(newUrl));
}
......@@ -649,12 +639,16 @@ QList<ModelNode> filterNodesForSkipItems(const QList<ModelNode> &nodeList)
CreateSceneCommand NodeInstanceView::createCreateSceneCommand()
{
QList<ModelNode> nodeList = filterNodesForSkipItems(allModelNodes());
QList<ModelNode> nodeList = allModelNodes();
QList<NodeInstance> instanceList;
foreach (const ModelNode &node, nodeList)
instanceList.append(loadNode(node));
foreach (const ModelNode &node, nodeList) {
NodeInstance instance = loadNode(node);
if (!isSkippedNode(node))
instanceList.append(instance);
}
nodeList = filterNodesForSkipItems(nodeList);
QList<VariantProperty> variantPropertyList;
QList<BindingProperty> bindingPropertyList;
......
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