Commit b108f72b authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner: remove DesignDocument::goIntoSelectedComponent()



This function is highly confusing as a member of DesignDocument
and the logic can be implemented directly in the ShortcutManager.

Change-Id: Id722dcb71b542b4780614c9f895f06150ccb67ca
Reviewed-by: default avatarMarco Bubke <marco.bubke@digia.com>
parent e5c323e8
......@@ -311,21 +311,6 @@ void DesignDocument::changeToExternalSubComponent(const QString &fileName)
Core::EditorManager::openEditor(fileName, Core::Id(), Core::EditorManager::DoNotMakeVisible);
}
void DesignDocument::goIntoSelectedComponent()
{
if (currentModel())
return;
QList<ModelNode> selectedNodes;
if (rewriterView())
selectedNodes = view()->selectedModelNodes();
if (selectedNodes.count() == 1) {
viewManager().setComponentNode(selectedNodes.first());
DocumentManager::goIntoComponent(selectedNodes.first());
}
}
void DesignDocument::attachRewriterToModel()
{
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
......
......@@ -97,8 +97,6 @@ public:
void resetToDocumentModel();
void goIntoSelectedComponent();
void changeToDocumentModel();
signals:
......
......@@ -304,8 +304,12 @@ void ShortCutManager::redoAvailable(bool isAvailable)
void ShortCutManager::goIntoComponent()
{
if (currentDesignDocument())
currentDesignDocument()->goIntoSelectedComponent();
if (currentDesignDocument()
&& currentDesignDocument()->currentModel()
&& currentDesignDocument()->rewriterView()
&& currentDesignDocument()->rewriterView()->hasSingleSelectedModelNode()) {
DocumentManager::goIntoComponent(currentDesignDocument()->rewriterView()->singleSelectedModelNode());
}
}
} // namespace QmlDesigner
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