QmlDesigner: Fix clazy warning

Do not call static member functions by instance.

Change-Id: Iacc7abd7e93b4612fcaa5288cd428a569f64615c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Thomas Hartmann
2018-08-01 13:46:30 +02:00
parent 96d573147c
commit 07b96ccc37
3 changed files with 5 additions and 5 deletions

View File

@@ -261,7 +261,7 @@ QList<QmlJSEditor::FindReferences::Usage> FindImplementation::run(const QString
//Parse always the latest version of document //Parse always the latest version of document
QmlJS::Dialect dialect = QmlJS::ModelManagerInterface::guessLanguageOfFile(fileName); QmlJS::Dialect dialect = QmlJS::ModelManagerInterface::guessLanguageOfFile(fileName);
QmlJS::Document::MutablePtr documentUpdate = QmlJS::Document::create(fileName, dialect); 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()) if (documentUpdate->parseQml())
modelManager->updateDocument(documentUpdate); modelManager->updateDocument(documentUpdate);

View File

@@ -152,13 +152,13 @@ void PropertyEditorView::changeValue(const QString &name)
if (newId == m_selectedNode.id()) if (newId == m_selectedNode.id())
return; return;
if (m_selectedNode.isValidId(newId) && !hasId(newId)) { if (QmlDesigner::ModelNode::isValidId(newId) && !hasId(newId)) {
m_selectedNode.setIdWithRefactoring(newId); m_selectedNode.setIdWithRefactoring(newId);
} else { } else {
m_locked = true; m_locked = true;
value->setValue(m_selectedNode.id()); value->setValue(m_selectedNode.id());
m_locked = false; 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)); Core::AsynchronousMessageBox::warning(tr("Invalid Id"), tr("%1 is an invalid id.").arg(newId));
else else
Core::AsynchronousMessageBox::warning(tr("Invalid Id"), tr("%1 already exists.").arg(newId)); Core::AsynchronousMessageBox::warning(tr("Invalid Id"), tr("%1 already exists.").arg(newId));

View File

@@ -133,9 +133,9 @@ void ShortCutManager::registerActions(const Core::Context &qmlDesignerMainContex
//Save //Save
Core::ActionManager::registerAction(&m_saveAction, Core::Constants::SAVE, qmlDesignerMainContext); 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(); QmlDesignerPlugin::instance()->viewManager().reformatFileUsingTextEditorView();
em->saveDocument(); Core::EditorManager::saveDocument();
}); });
Core::Command *command = nullptr; Core::Command *command = nullptr;