aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2022-11-15 14:19:06 +0100
committerDavid Schulz <david.schulz@qt.io>2022-11-17 13:23:55 +0000
commit0e4b0a26d34c523463ea68b27caf69cbb89083f2 (patch)
tree51a8efe27b419a613a88b6f2497e7a701526b47a /src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp
parentaa6633ca2157b686d5398e8a09f538c15089fd36 (diff)
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/cppeditor/followsymbol_switchmethoddecldef_test.cpp')
-rw-r--r--src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp
index ed590e7406..38cd0cdebc 100644
--- a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp
+++ b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp
@@ -17,6 +17,7 @@
#include <projectexplorer/kitmanager.h>
#include <projectexplorer/projectexplorer.h>
+#include <texteditor/codeassist/assistinterface.h>
#include <texteditor/codeassist/asyncprocessor.h>
#include <texteditor/codeassist/genericproposalmodel.h>
#include <texteditor/codeassist/iassistprocessor.h>
@@ -119,14 +120,13 @@ public:
{
VirtualFunctionAssistProvider::configure(params);
- AssistInterface *assistInterface
+ std::unique_ptr<AssistInterface> assistInterface
= m_editorWidget->createAssistInterface(FollowSymbol, ExplicitlyInvoked);
const QScopedPointer<AsyncProcessor> processor(
- dynamic_cast<AsyncProcessor *>(createProcessor(assistInterface)));
- const QScopedPointer<IAssistProposal> immediateProposal(
- processor->immediateProposal(assistInterface));
- const QScopedPointer<IAssistProposal> finalProposal(
- processor->performAsync(assistInterface));
+ dynamic_cast<AsyncProcessor *>(createProcessor(assistInterface.get())));
+ processor->setupAssistInterface(std::move(assistInterface));
+ const QScopedPointer<IAssistProposal> immediateProposal(processor->immediateProposal());
+ const QScopedPointer<IAssistProposal> finalProposal(processor->performAsync());
VirtualFunctionAssistProvider::clearParams();