Commit 91b79844 authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner.documentController: bugfix for crumblebar

This fixes a crash bug.

Change-Id: Ibfe5c30910fed8b5e3132a05bc6a2eec39d4d308
Reviewed-by: default avatarMarco Bubke <marco.bubke@nokia.com>
parent 6fb60206
......@@ -448,9 +448,10 @@ void DesignDocumentController::changeCurrentModelTo(const ModelNode &node)
if (Internal::DesignModeWidget::instance()->currentDesignDocumentController() != this)
return;
DesignDocumentControllerPrivate::clearCrumblePath = false;
while (!d->formEditorView->crumblePath()->dataForLastIndex().value<CrumbleBarInfo>().modelNode.isRootNode())
while (d->formEditorView->crumblePath()->dataForLastIndex().value<CrumbleBarInfo>().modelNode.isValid() &&
!d->formEditorView->crumblePath()->dataForLastIndex().value<CrumbleBarInfo>().modelNode.isRootNode())
d->formEditorView->crumblePath()->popElement();
if (node.isRootNode())
if (node.isRootNode() && d->formEditorView->crumblePath()->dataForLastIndex().isValid())
d->formEditorView->crumblePath()->popElement();
changeToSubComponent(node);
DesignDocumentControllerPrivate::clearCrumblePath = true;
......@@ -537,8 +538,10 @@ void DesignDocumentController::goIntoComponent()
if (d->formEditorView)
selectedNodes = d->formEditorView->selectedModelNodes();
DesignDocumentControllerPrivate::clearCrumblePath = false;
if (selectedNodes.count() == 1)
ModelNodeAction::goIntoComponent(selectedNodes.first());
DesignDocumentControllerPrivate::clearCrumblePath = true;
}
void DesignDocumentController::loadCurrentModel()
......
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