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
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);

View File

@@ -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));

View File

@@ -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;