forked from qt-creator/qt-creator
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>
This commit is contained in:
committed by
Tim Jenssen
parent
0bb272d411
commit
fd89043de2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user