From 0e4b0a26d34c523463ea68b27caf69cbb89083f2 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Tue, 15 Nov 2022 14:19:06 +0100 Subject: 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: Reviewed-by: Christian Stenger Reviewed-by: Christian Kandeler --- .../cppeditor/followsymbol_switchmethoddecldef_test.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp') diff --git a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp index ed590e7406e..38cd0cdebcf 100644 --- a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp +++ b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -119,14 +120,13 @@ public: { VirtualFunctionAssistProvider::configure(params); - AssistInterface *assistInterface + std::unique_ptr assistInterface = m_editorWidget->createAssistInterface(FollowSymbol, ExplicitlyInvoked); const QScopedPointer processor( - dynamic_cast(createProcessor(assistInterface))); - const QScopedPointer immediateProposal( - processor->immediateProposal(assistInterface)); - const QScopedPointer finalProposal( - processor->performAsync(assistInterface)); + dynamic_cast(createProcessor(assistInterface.get()))); + processor->setupAssistInterface(std::move(assistInterface)); + const QScopedPointer immediateProposal(processor->immediateProposal()); + const QScopedPointer finalProposal(processor->performAsync()); VirtualFunctionAssistProvider::clearParams(); -- cgit v1.2.3