forked from qt-creator/qt-creator
QmlDesigner: Refactor currentModel() getters in QmlDesignerPlugin
Change-Id: I6d5085b591439cc2e79ca0f9872a1c0497c5f220 Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
This commit is contained in:
@@ -225,7 +225,7 @@ void QmlDesignerPlugin::showDesigner()
|
||||
void QmlDesignerPlugin::hideDesigner()
|
||||
{
|
||||
if (currentDesignDocument()
|
||||
&& currentDesignDocument()->currentModel()
|
||||
&& currentModel()
|
||||
&& !currentDesignDocument()->hasQmlSyntaxErrors())
|
||||
jumpTextCursorToSelectedModelNode();
|
||||
|
||||
@@ -343,7 +343,7 @@ void QmlDesignerPlugin::deactivateAutoSynchronization()
|
||||
|
||||
void QmlDesignerPlugin::resetModelSelection()
|
||||
{
|
||||
if (rewriterView() && currentDesignDocument()->currentModel())
|
||||
if (rewriterView() && currentModel())
|
||||
rewriterView()->setSelectedModelNodes(QList<ModelNode>());
|
||||
}
|
||||
|
||||
@@ -352,6 +352,11 @@ RewriterView *QmlDesignerPlugin::rewriterView() const
|
||||
return currentDesignDocument()->rewriterView();
|
||||
}
|
||||
|
||||
Model *QmlDesignerPlugin::currentModel() const
|
||||
{
|
||||
return currentDesignDocument()->currentModel();
|
||||
}
|
||||
|
||||
static bool checkIfEditorIsQtQuick(Core::IEditor *editor)
|
||||
{
|
||||
if (editor)
|
||||
|
@@ -114,6 +114,7 @@ private: // functions
|
||||
void deactivateAutoSynchronization();
|
||||
void resetModelSelection();
|
||||
RewriterView *rewriterView() const;
|
||||
Model *currentModel() const;
|
||||
|
||||
private: // variables
|
||||
QmlDesignerPluginData *data;
|
||||
|
Reference in New Issue
Block a user