From ac5ca391ddcd706d58edd84a365dbc7abfe0745f Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 6 Jan 2025 12:00:34 +0100 Subject: [PATCH] QmlEditor: remove indirect QString::toUtf8/fromUtf8 roundtrip Change-Id: Ie83ba8ff03834f10ef1b4d23827141817deb1bf3 Reviewed-by: Christian Stenger --- src/plugins/qmljseditor/qmljseditorplugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmljseditor/qmljseditorplugin.cpp b/src/plugins/qmljseditor/qmljseditorplugin.cpp index 0678d79b383..7bb446ab9f2 100644 --- a/src/plugins/qmljseditor/qmljseditorplugin.cpp +++ b/src/plugins/qmljseditor/qmljseditorplugin.cpp @@ -226,7 +226,7 @@ void QmlJSEditorPluginPrivate::reformatFile() QmlJS::Document::MutablePtr latestDocument; const Utils::FilePath fileName = m_currentDocument->filePath(); - latestDocument = snapshot.documentFromSource(QString::fromUtf8(m_currentDocument->contents()), + latestDocument = snapshot.documentFromSource(m_currentDocument->plainText(), fileName, QmlJS::ModelManagerInterface::guessLanguageOfFile(fileName)); latestDocument->parseQml();