forked from qt-creator/qt-creator
QmlDesigner: remove DesignDocument::changeToExternalSubComponent()
This function did nothing but call EditorManager::openEditor(), so we can call it directly instead. It was not used consistently anyway. Change-Id: I639ef346164be9260e887faac5dc6651ccfd92c5 Reviewed-by: Marco Bubke <marco.bubke@digia.com>
This commit is contained in:
@@ -306,11 +306,6 @@ void DesignDocument::changeToSubComponent(const ModelNode &componentNode)
|
|||||||
attachRewriterToModel();
|
attachRewriterToModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DesignDocument::changeToExternalSubComponent(const QString &fileName)
|
|
||||||
{
|
|
||||||
Core::EditorManager::openEditor(fileName, Core::Id(), Core::EditorManager::DoNotMakeVisible);
|
|
||||||
}
|
|
||||||
|
|
||||||
void DesignDocument::attachRewriterToModel()
|
void DesignDocument::attachRewriterToModel()
|
||||||
{
|
{
|
||||||
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||||
|
@@ -119,7 +119,6 @@ public slots:
|
|||||||
void updateActiveQtVersion();
|
void updateActiveQtVersion();
|
||||||
void changeToSubComponentAndPushOnCrumblePath(const ModelNode &componentNode);
|
void changeToSubComponentAndPushOnCrumblePath(const ModelNode &componentNode);
|
||||||
void changeToSubComponent(const ModelNode &componentNode);
|
void changeToSubComponent(const ModelNode &componentNode);
|
||||||
void changeToExternalSubComponent(const QString &m_oldFileName);
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void updateFileName(const QString &oldFileName, const QString &newFileName);
|
void updateFileName(const QString &oldFileName, const QString &newFileName);
|
||||||
|
@@ -102,13 +102,14 @@ static inline void openFileForComponent(const ModelNode &node)
|
|||||||
if (node.metaInfo().isFileComponent()) {
|
if (node.metaInfo().isFileComponent()) {
|
||||||
//getWidthHeight(node, width, height);
|
//getWidthHeight(node, width, height);
|
||||||
getProperties(node, propertyHash);
|
getProperties(node, propertyHash);
|
||||||
currentDesignDocument()->changeToExternalSubComponent(node.metaInfo().componentFileName());
|
Core::EditorManager::openEditor(node.metaInfo().componentFileName(), Core::Id(), Core::EditorManager::DoNotMakeVisible);
|
||||||
} else if (node.metaInfo().isView() &&
|
} else if (node.metaInfo().isView() &&
|
||||||
node.hasNodeProperty("delegate") &&
|
node.hasNodeProperty("delegate") &&
|
||||||
node.nodeProperty("delegate").modelNode().metaInfo().isFileComponent()) {
|
node.nodeProperty("delegate").modelNode().metaInfo().isFileComponent()) {
|
||||||
//getWidthHeight(node, width, height);
|
//getWidthHeight(node, width, height);
|
||||||
getProperties(node, propertyHash);
|
getProperties(node, propertyHash);
|
||||||
currentDesignDocument()->changeToExternalSubComponent(node.nodeProperty("delegate").modelNode().metaInfo().componentFileName());
|
Core::EditorManager::openEditor(node.nodeProperty("delegate").modelNode().metaInfo().componentFileName(),
|
||||||
|
Core::Id(), Core::EditorManager::DoNotMakeVisible);
|
||||||
}
|
}
|
||||||
ModelNode rootModelNode = currentDesignDocument()->rewriterView()->rootModelNode();
|
ModelNode rootModelNode = currentDesignDocument()->rewriterView()->rootModelNode();
|
||||||
applyProperties(rootModelNode, propertyHash);
|
applyProperties(rootModelNode, propertyHash);
|
||||||
|
Reference in New Issue
Block a user