From 07b96ccc37fe05428f9dd1543ba5fb3130433db3 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 1 Aug 2018 13:46:30 +0200 Subject: [PATCH] QmlDesigner: Fix clazy warning Do not call static member functions by instance. Change-Id: Iacc7abd7e93b4612fcaa5288cd428a569f64615c Reviewed-by: Alessandro Portale --- .../components/componentcore/findimplementation.cpp | 2 +- .../components/propertyeditor/propertyeditorview.cpp | 4 ++-- src/plugins/qmldesigner/shortcutmanager.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/qmldesigner/components/componentcore/findimplementation.cpp b/src/plugins/qmldesigner/components/componentcore/findimplementation.cpp index fa13ef68110..a3a33f01403 100644 --- a/src/plugins/qmldesigner/components/componentcore/findimplementation.cpp +++ b/src/plugins/qmldesigner/components/componentcore/findimplementation.cpp @@ -261,7 +261,7 @@ QList FindImplementation::run(const QString //Parse always the latest version of document QmlJS::Dialect dialect = QmlJS::ModelManagerInterface::guessLanguageOfFile(fileName); QmlJS::Document::MutablePtr documentUpdate = QmlJS::Document::create(fileName, dialect); - documentUpdate->setSource(modelManager->workingCopy().source(fileName)); + documentUpdate->setSource(QmlJS::ModelManagerInterface::workingCopy().source(fileName)); if (documentUpdate->parseQml()) modelManager->updateDocument(documentUpdate); diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp index 8dd39a607cc..e046eceb647 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp @@ -152,13 +152,13 @@ void PropertyEditorView::changeValue(const QString &name) if (newId == m_selectedNode.id()) return; - if (m_selectedNode.isValidId(newId) && !hasId(newId)) { + if (QmlDesigner::ModelNode::isValidId(newId) && !hasId(newId)) { m_selectedNode.setIdWithRefactoring(newId); } else { m_locked = true; value->setValue(m_selectedNode.id()); m_locked = false; - if (!m_selectedNode.isValidId(newId)) + if (!QmlDesigner::ModelNode::isValidId(newId)) Core::AsynchronousMessageBox::warning(tr("Invalid Id"), tr("%1 is an invalid id.").arg(newId)); else Core::AsynchronousMessageBox::warning(tr("Invalid Id"), tr("%1 already exists.").arg(newId)); diff --git a/src/plugins/qmldesigner/shortcutmanager.cpp b/src/plugins/qmldesigner/shortcutmanager.cpp index 7c914f7e084..0000adfd681 100644 --- a/src/plugins/qmldesigner/shortcutmanager.cpp +++ b/src/plugins/qmldesigner/shortcutmanager.cpp @@ -133,9 +133,9 @@ void ShortCutManager::registerActions(const Core::Context &qmlDesignerMainContex //Save Core::ActionManager::registerAction(&m_saveAction, Core::Constants::SAVE, qmlDesignerMainContext); - connect(&m_saveAction, &QAction::triggered, em, [em] { + connect(&m_saveAction, &QAction::triggered, em, [] { QmlDesignerPlugin::instance()->viewManager().reformatFileUsingTextEditorView(); - em->saveDocument(); + Core::EditorManager::saveDocument(); }); Core::Command *command = nullptr;