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

@@ -76,19 +76,19 @@ CppRefactoringFile::CppRefactoringFile(const FilePath &filePath, const QSharedPo
{
const Snapshot &snapshot = data->m_snapshot;
m_cppDocument = snapshot.document(filePath);
m_formattingEnabled = true;
enableFormatting();
}
CppRefactoringFile::CppRefactoringFile(QTextDocument *document, const FilePath &filePath)
: RefactoringFile(document, filePath)
{
m_formattingEnabled = true;
enableFormatting();
}
CppRefactoringFile::CppRefactoringFile(TextEditor::TextEditorWidget *editor)
: RefactoringFile(editor)
{
m_formattingEnabled = true;
enableFormatting();
}
Document::Ptr CppRefactoringFile::cppDocument() const
@@ -235,7 +235,7 @@ const Token &CppRefactoringFile::tokenAt(unsigned index) const
void CppRefactoringFile::fileChanged()
{
QTC_ASSERT(!m_filePath.isEmpty(), return);
QTC_ASSERT(!filePath().isEmpty(), return);
m_cppDocument.clear();
CppModelManager::updateSourceFiles({filePath()});
}