TextEditor: Clean up RefactoringFile interface

Change-Id: I1e415b6b51065d16bc49a25118931723b600c00b
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Christian Kandeler
2023-11-17 13:14:13 +01:00
parent cf74409bac
commit ac952955a4
3 changed files with 19 additions and 18 deletions

View File

@@ -61,7 +61,7 @@ QmlJSRefactoringFile::QmlJSRefactoringFile(
{
// the RefactoringFile is invalid if its not for a file with qml or js code
if (ModelManagerInterface::guessLanguageOfFile(filePath) == Dialect::NoLanguage)
m_filePath.clear();
invalidate();
}
QmlJSRefactoringFile::QmlJSRefactoringFile(TextEditor::TextEditorWidget *editor, Document::Ptr document)
@@ -69,7 +69,7 @@ QmlJSRefactoringFile::QmlJSRefactoringFile(TextEditor::TextEditorWidget *editor,
, m_qmljsDocument(document)
{
if (document)
m_filePath = document->fileName();
setFilePath(document->fileName()); // TODO: Is this really a different file path than in the editor?
}
Document::Ptr QmlJSRefactoringFile::qmljsDocument() const
@@ -136,7 +136,7 @@ bool QmlJSRefactoringFile::isCursorOn(SourceLocation loc) const
void QmlJSRefactoringFile::fileChanged()
{
QTC_ASSERT(!m_filePath.isEmpty(), return);
QTC_ASSERT(!filePath().isEmpty(), return);
m_qmljsDocument.clear();
m_data->m_modelManager->updateSourceFiles({filePath()}, true);
}