diff options
| author | David Schulz <david.schulz@qt.io> | 2022-11-15 14:19:06 +0100 |
|---|---|---|
| committer | David Schulz <david.schulz@qt.io> | 2022-11-17 13:23:55 +0000 |
| commit | 0e4b0a26d34c523463ea68b27caf69cbb89083f2 (patch) | |
| tree | 51a8efe27b419a613a88b6f2497e7a701526b47a /src/plugins/texteditor/codeassist/asyncprocessor.cpp | |
| parent | aa6633ca2157b686d5398e8a09f538c15089fd36 (diff) | |
| download | qt-creator-0e4b0a26d34c523463ea68b27caf69cbb89083f2.tar.gz | |
Editor: move ownership of assist interface to processor
This way the base class can manage the lifetime of the interface object
and it doesn't need to be done in each implementation of perform.
Change-Id: Ie1ce742e31b688a337533ee6c57d376146e25ace
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/texteditor/codeassist/asyncprocessor.cpp')
| -rw-r--r-- | src/plugins/texteditor/codeassist/asyncprocessor.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/plugins/texteditor/codeassist/asyncprocessor.cpp b/src/plugins/texteditor/codeassist/asyncprocessor.cpp index 2ee5ada35f..2ab696af47 100644 --- a/src/plugins/texteditor/codeassist/asyncprocessor.cpp +++ b/src/plugins/texteditor/codeassist/asyncprocessor.cpp @@ -17,14 +17,13 @@ AsyncProcessor::AsyncProcessor() }); } -IAssistProposal *AsyncProcessor::perform(AssistInterface *interface) +IAssistProposal *AsyncProcessor::perform() { - IAssistProposal *result = immediateProposal(interface); - m_interface = interface; - m_interface->prepareForAsyncUse(); + IAssistProposal *result = immediateProposal(); + interface()->prepareForAsyncUse(); m_watcher.setFuture(Utils::runAsync([this]() { - m_interface->recreateTextDocument(); - return performAsync(m_interface); + interface()->recreateTextDocument(); + return performAsync(); })); return result; } @@ -44,9 +43,8 @@ void AsyncProcessor::cancel() }); } -IAssistProposal *AsyncProcessor::immediateProposal(AssistInterface *interface) +IAssistProposal *AsyncProcessor::immediateProposal() { - Q_UNUSED(interface) return nullptr; } |
