diff options
author | Fawzi Mohamed <fawzi.mohamed@qt.io> | 2022-06-20 12:35:13 +0200 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@qt.io> | 2022-07-13 17:13:23 +0000 |
commit | fd89043de2f8de1588ee61514170e0168e13e238 (patch) | |
tree | 8a9dedc64d065bc8c5a076607421adf636c0177a /src/plugins/qmljstools/qmljsrefactoringchanges.cpp | |
parent | 0bb272d41112dcdc3a92c8b6320294c415d630e5 (diff) | |
download | qt-creator-fd89043de2f8de1588ee61514170e0168e13e238.tar.gz |
qmljs: (QString -> Utils::FilePath)++
convert more QString containing paths to Utils::FilePath
Change-Id: I1219d7d147993e48cfa641dc9bea72ab38c90f51
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Diffstat (limited to 'src/plugins/qmljstools/qmljsrefactoringchanges.cpp')
-rw-r--r-- | src/plugins/qmljstools/qmljsrefactoringchanges.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/plugins/qmljstools/qmljsrefactoringchanges.cpp b/src/plugins/qmljstools/qmljsrefactoringchanges.cpp index 98d86199dd..65dc3f3856 100644 --- a/src/plugins/qmljstools/qmljsrefactoringchanges.cpp +++ b/src/plugins/qmljstools/qmljsrefactoringchanges.cpp @@ -90,7 +90,7 @@ public: void fileChanged(const Utils::FilePath &filePath) override { - m_modelManager->updateSourceFiles({filePath.toString()}, true); + m_modelManager->updateSourceFiles({filePath}, true); } ModelManagerInterface *m_modelManager; @@ -129,7 +129,7 @@ QmlJSRefactoringFile::QmlJSRefactoringFile( : RefactoringFile(filePath, data) { // the RefactoringFile is invalid if its not for a file with qml or js code - if (ModelManagerInterface::guessLanguageOfFile(filePath.toString()) == Dialect::NoLanguage) + if (ModelManagerInterface::guessLanguageOfFile(filePath) == Dialect::NoLanguage) m_filePath.clear(); } @@ -138,18 +138,19 @@ QmlJSRefactoringFile::QmlJSRefactoringFile(TextEditor::TextEditorWidget *editor, , m_qmljsDocument(document) { if (document) - m_filePath = Utils::FilePath::fromString(document->fileName()); + m_filePath = document->fileName(); } Document::Ptr QmlJSRefactoringFile::qmljsDocument() const { if (!m_qmljsDocument) { const QString source = document()->toPlainText(); - const QString name = filePath().toString(); const Snapshot &snapshot = data()->m_snapshot; - Document::MutablePtr newDoc = snapshot.documentFromSource(source, name, - ModelManagerInterface::guessLanguageOfFile(name)); + Document::MutablePtr newDoc + = snapshot.documentFromSource(source, + filePath(), + ModelManagerInterface::guessLanguageOfFile(filePath())); newDoc->parse(); m_qmljsDocument = newDoc; } |