forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -1045,14 +1045,14 @@ public:
|
||||
: m_provider(static_cast<const FakeVimCompletionAssistProvider *>(provider))
|
||||
{}
|
||||
|
||||
IAssistProposal *performAsync(AssistInterface *interface) override
|
||||
IAssistProposal *performAsync() override
|
||||
{
|
||||
const QString &needle = m_provider->needle();
|
||||
|
||||
const int basePosition = interface->position() - needle.size();
|
||||
const int basePosition = interface()->position() - needle.size();
|
||||
|
||||
QTextCursor tc(interface->textDocument());
|
||||
tc.setPosition(interface->position());
|
||||
QTextCursor tc(interface()->textDocument());
|
||||
tc.setPosition(interface()->position());
|
||||
tc.movePosition(QTextCursor::Start, QTextCursor::MoveAnchor);
|
||||
|
||||
QList<AssistProposalItemInterface *> items;
|
||||
@@ -1078,7 +1078,6 @@ public:
|
||||
}
|
||||
//qDebug() << "COMPLETIONS" << completions->size();
|
||||
|
||||
delete interface;
|
||||
return new GenericProposal(basePosition,
|
||||
GenericProposalModelPtr(new FakeVimAssistProposalModel(items)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user