Commit b7e4c7d5 authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner.documentController: fixing copy n paste

There were a few mistakes in the recent refactoring.

Change-Id: Id6d36e2c9fad5b583ab99e0583acefe51e1ffba0
Reviewed-by: default avatarMarco Bubke <marco.bubke@nokia.com>
parent 01661ac5
......@@ -632,7 +632,7 @@ void DesignDocumentController::copySelected()
DesignDocumentControllerView view;
copyModel->attachView(&view);
m_model->attachView(&view);
if (view.selectedModelNodes().isEmpty())
return;
......@@ -652,7 +652,7 @@ void DesignDocumentController::copySelected()
if (!selectedNode.isValid())
return;
copyModel->detachView(&view);
m_model->detachView(&view);
copyModel->attachView(&view);
view.replaceModel(selectedNode);
......@@ -662,7 +662,7 @@ void DesignDocumentController::copySelected()
view.toClipboard();
} else { //multi items selected
copyModel->detachView(&view);
m_model->detachView(&view);
copyModel->attachView(&view);
foreach (ModelNode node, view.rootModelNode().allDirectSubModelNodes()) {
......@@ -743,7 +743,7 @@ void DesignDocumentController::paste()
qDebug() << rootNode;
qDebug() << selectedNodes;
pasteModel->detachView(&view);
pasteModel->attachView(&view);
m_model->attachView(&view);
ModelNode targetNode;
......@@ -789,7 +789,7 @@ void DesignDocumentController::paste()
RewriterTransaction transaction(m_formEditorView.data());
pasteModel->detachView(&view);
pasteModel->attachView(&view);
m_model->attachView(&view);
ModelNode pastedNode(view.insertModel(rootNode));
ModelNode targetNode;
......
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