diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2023-11-17 13:36:46 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2023-11-21 14:24:49 +0000 |
commit | 116798e54479bd040da96cf79d422528ca49a5a8 (patch) | |
tree | cb57005764802226442e63a56d4be4e232a0ed43 | |
parent | 7e38745706a8c017a4d310af32ae0ca4c9150464 (diff) |
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>
-rw-r--r-- | src/plugins/cppeditor/cpprefactoringchanges.cpp | 4 | ||||
-rw-r--r-- | src/plugins/qmljstools/qmljsrefactoringchanges.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/cppeditor/cpprefactoringchanges.cpp b/src/plugins/cppeditor/cpprefactoringchanges.cpp index e15dca72cb..207d359cb8 100644 --- a/src/plugins/cppeditor/cpprefactoringchanges.cpp +++ b/src/plugins/cppeditor/cpprefactoringchanges.cpp @@ -60,12 +60,12 @@ CppRefactoringFilePtr CppRefactoringChanges::file(TextEditor::TextEditorWidget * 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 { - return file(filePath).staticCast<CppRefactoringFile>(); + return CppRefactoringFilePtr(new CppRefactoringFile(filePath, m_data)); } CppRefactoringFileConstPtr CppRefactoringChanges::fileNoEditor(const FilePath &filePath) const diff --git a/src/plugins/qmljstools/qmljsrefactoringchanges.cpp b/src/plugins/qmljstools/qmljsrefactoringchanges.cpp index 0e03454250..66ce4102b4 100644 --- a/src/plugins/qmljstools/qmljsrefactoringchanges.cpp +++ b/src/plugins/qmljstools/qmljsrefactoringchanges.cpp @@ -36,12 +36,12 @@ QmlJSRefactoringChanges::QmlJSRefactoringChanges(ModelManagerInterface *modelMan 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 { - return file(filePath).staticCast<QmlJSRefactoringFile>(); + return QmlJSRefactoringFilePtr(new QmlJSRefactoringFile(filePath, m_data)); } QmlJSRefactoringFilePtr QmlJSRefactoringChanges::file( |