CppEditor/QmlJSTools: Simplify RefactoringFile::file() re-implementation

Change-Id: I8f2af8de3786ecf4400bc42019d496bd52bb2545
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2023-11-17 13:36:46 +01:00
parent 7e38745706
commit 116798e544
2 changed files with 4 additions and 4 deletions

View File

@@ -60,12 +60,12 @@ CppRefactoringFilePtr CppRefactoringChanges::file(TextEditor::TextEditorWidget *
TextEditor::RefactoringFilePtr CppRefactoringChanges::file(const FilePath &filePath) const TextEditor::RefactoringFilePtr CppRefactoringChanges::file(const FilePath &filePath) const
{ {
return TextEditor::RefactoringFilePtr(new CppRefactoringFile(filePath, m_data)); return cppFile(filePath);
} }
CppRefactoringFilePtr CppRefactoringChanges::cppFile(const Utils::FilePath &filePath) const CppRefactoringFilePtr CppRefactoringChanges::cppFile(const Utils::FilePath &filePath) const
{ {
return file(filePath).staticCast<CppRefactoringFile>(); return CppRefactoringFilePtr(new CppRefactoringFile(filePath, m_data));
} }
CppRefactoringFileConstPtr CppRefactoringChanges::fileNoEditor(const FilePath &filePath) const CppRefactoringFileConstPtr CppRefactoringChanges::fileNoEditor(const FilePath &filePath) const

View File

@@ -36,12 +36,12 @@ QmlJSRefactoringChanges::QmlJSRefactoringChanges(ModelManagerInterface *modelMan
TextEditor::RefactoringFilePtr QmlJSRefactoringChanges::file(const Utils::FilePath &filePath) const TextEditor::RefactoringFilePtr QmlJSRefactoringChanges::file(const Utils::FilePath &filePath) const
{ {
return QmlJSRefactoringFilePtr(new QmlJSRefactoringFile(filePath, m_data)); return qmlJSFile(filePath);
} }
QmlJSRefactoringFilePtr QmlJSRefactoringChanges::qmlJSFile(const Utils::FilePath &filePath) const QmlJSRefactoringFilePtr QmlJSRefactoringChanges::qmlJSFile(const Utils::FilePath &filePath) const
{ {
return file(filePath).staticCast<QmlJSRefactoringFile>(); return QmlJSRefactoringFilePtr(new QmlJSRefactoringFile(filePath, m_data));
} }
QmlJSRefactoringFilePtr QmlJSRefactoringChanges::file( QmlJSRefactoringFilePtr QmlJSRefactoringChanges::file(