forked from qt-creator/qt-creator
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: Marco Bubke <marco.bubke@digia.com>
This commit is contained in:
@@ -311,21 +311,6 @@ void DesignDocument::changeToExternalSubComponent(const QString &fileName)
|
|||||||
Core::EditorManager::openEditor(fileName, Core::Id(), Core::EditorManager::DoNotMakeVisible);
|
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()
|
void DesignDocument::attachRewriterToModel()
|
||||||
{
|
{
|
||||||
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||||
|
@@ -97,8 +97,6 @@ public:
|
|||||||
|
|
||||||
void resetToDocumentModel();
|
void resetToDocumentModel();
|
||||||
|
|
||||||
void goIntoSelectedComponent();
|
|
||||||
|
|
||||||
void changeToDocumentModel();
|
void changeToDocumentModel();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
@@ -304,8 +304,12 @@ void ShortCutManager::redoAvailable(bool isAvailable)
|
|||||||
|
|
||||||
void ShortCutManager::goIntoComponent()
|
void ShortCutManager::goIntoComponent()
|
||||||
{
|
{
|
||||||
if (currentDesignDocument())
|
if (currentDesignDocument()
|
||||||
currentDesignDocument()->goIntoSelectedComponent();
|
&& currentDesignDocument()->currentModel()
|
||||||
|
&& currentDesignDocument()->rewriterView()
|
||||||
|
&& currentDesignDocument()->rewriterView()->hasSingleSelectedModelNode()) {
|
||||||
|
DocumentManager::goIntoComponent(currentDesignDocument()->rewriterView()->singleSelectedModelNode());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace QmlDesigner
|
} // namespace QmlDesigner
|
||||||
|
Reference in New Issue
Block a user