summaryrefslogtreecommitdiff
path: root/src/plugins/qmldesigner/qmldesignerplugin.cpp
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@digia.com>2014-06-30 14:58:11 +0200
committerMarco Bubke <marco.bubke@digia.com>2014-07-01 14:24:45 +0200
commitc82eafd13f18511042da9f10aada8ef5d6967aad (patch)
tree5f9cff06385801593fe7294f23aeed8e1ad5ff7b /src/plugins/qmldesigner/qmldesignerplugin.cpp
parentb49ba79973f8ad016c186c449000419871bf65d8 (diff)
downloadqt-creator-c82eafd13f18511042da9f10aada8ef5d6967aad.tar.gz
QmlDesigner: Refactor currentModel() getters in QmlDesignerPlugin
Change-Id: I6d5085b591439cc2e79ca0f9872a1c0497c5f220 Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
Diffstat (limited to 'src/plugins/qmldesigner/qmldesignerplugin.cpp')
-rw-r--r--src/plugins/qmldesigner/qmldesignerplugin.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/qmldesigner/qmldesignerplugin.cpp b/src/plugins/qmldesigner/qmldesignerplugin.cpp
index a770507599..8a08aaf055 100644
--- a/src/plugins/qmldesigner/qmldesignerplugin.cpp
+++ b/src/plugins/qmldesigner/qmldesignerplugin.cpp
@@ -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)