QmlDesigner: Fix crumble bar for infile components

CrumbleBarInfo contains the ModelNode to properly identify the node.
We cannot use the id, because no every component has an id.

If the crumble bar only contains one item it is hidden.

Change-Id: I4d421eaad8962aa9043567e1f27957b1aa089766
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
This commit is contained in:
Thomas Hartmann
2013-08-12 17:30:50 +02:00
parent 5a6008d2f5
commit 13033734a1
6 changed files with 60 additions and 27 deletions

View File

@@ -285,18 +285,11 @@ void DesignDocument::changeToInFileComponentModel(ComponentTextModifier *textMod
viewManager().attachViewsExceptRewriterAndComponetView();
}
void DesignDocument::changeToSubComponentAndPushOnCrumblePath(const ModelNode &componentNode)
void DesignDocument::changeToSubComponent(const ModelNode &componentNode)
{
if (QmlDesignerPlugin::instance()->currentDesignDocument() != this)
return;
changeToSubComponent(componentNode);
QmlDesignerPlugin::instance()->viewManager().pushInFileComponentOnCrambleBar(componentNode.id());
}
void DesignDocument::changeToSubComponent(const ModelNode &componentNode)
{
if (m_inFileComponentModel)
changeToDocumentModel();
@@ -304,6 +297,8 @@ void DesignDocument::changeToSubComponent(const ModelNode &componentNode)
if (subComponentLoaded)
attachRewriterToModel();
QmlDesignerPlugin::instance()->viewManager().pushInFileComponentOnCrumbleBar(componentNode);
}
void DesignDocument::attachRewriterToModel()