diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2023-11-16 16:09:26 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2023-11-17 09:43:02 +0000 |
commit | 6f3bc431fc5a0bcde258f53d8c6e1d2d5ad80539 (patch) | |
tree | 82467a5b2270342371850832c3b1fba3ea12c0b4 /src/plugins/texteditor/refactoringchanges.cpp | |
parent | 4c0abb6d2c93704a1909b3f24dfb02c0e191fd31 (diff) |
TextEditor: Move more code into RefactoringFile
We want to get rid of RefactoringChangesData.
Change-Id: Ia428563a0ff70ec9660761beac3eb7168b8e9eca
Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/texteditor/refactoringchanges.cpp')
-rw-r--r-- | src/plugins/texteditor/refactoringchanges.cpp | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/src/plugins/texteditor/refactoringchanges.cpp b/src/plugins/texteditor/refactoringchanges.cpp index fdff256758..659d06b1b9 100644 --- a/src/plugins/texteditor/refactoringchanges.cpp +++ b/src/plugins/texteditor/refactoringchanges.cpp @@ -118,7 +118,7 @@ bool RefactoringFile::create(const QString &contents, bool reindent, bool openEd // Reindent the contents: if (reindent) { cursor.select(QTextCursor::Document); - m_data->indentSelection(cursor, m_filePath, nullptr); + indentSelection(cursor, nullptr); } cursor.endEditBlock(); @@ -375,9 +375,9 @@ void RefactoringFile::indentOrReindent(const RefactoringSelections &ranges, QTextCursor selection(anchor); selection.setPosition(position.position(), QTextCursor::KeepAnchor); if (indent == Indent) - m_data->indentSelection(selection, m_filePath, document); + indentSelection(selection, document); else - m_data->reindentSelection(selection, m_filePath, document); + reindentSelection(selection, document); } } @@ -479,30 +479,20 @@ void RefactoringFile::doFormatting() } } -void RefactoringFile::fileChanged() +void RefactoringFile::indentSelection(const QTextCursor &selection, + const TextDocument *textDocument) const { - if (!m_filePath.isEmpty()) - m_data->fileChanged(m_filePath); + Q_UNUSED(selection) + Q_UNUSED(textDocument) } -RefactoringChangesData::~RefactoringChangesData() = default; - -void RefactoringChangesData::indentSelection(const QTextCursor &, - const FilePath &, - const TextDocument *) const -{ - qWarning() << Q_FUNC_INFO << "not implemented"; -} - -void RefactoringChangesData::reindentSelection(const QTextCursor &, - const FilePath &, - const TextDocument *) const +void RefactoringFile::reindentSelection(const QTextCursor &selection, + const TextDocument *textDocument) const { - qWarning() << Q_FUNC_INFO << "not implemented"; + Q_UNUSED(selection) + Q_UNUSED(textDocument) } -void RefactoringChangesData::fileChanged(const FilePath &) -{ -} +RefactoringChangesData::~RefactoringChangesData() = default; } // namespace TextEditor |