forked from qt-creator/qt-creator
CodeAssist: use shared pointer to pass around proposal models
Task-number: QTCREATORBUG-17752 Change-Id: Ia41f169b86ead209830e6f15764062389ced2b67 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -593,7 +593,7 @@ bool ClangCompletionAssistProcessor::sendCompletionRequest(int position,
|
||||
TextEditor::IAssistProposal *ClangCompletionAssistProcessor::createProposal(
|
||||
CompletionCorrection neededCorrection) const
|
||||
{
|
||||
ClangAssistProposalModel *model = new ClangAssistProposalModel(neededCorrection);
|
||||
TextEditor::GenericProposalModelPtr model(new ClangAssistProposalModel(neededCorrection));
|
||||
model->loadContent(m_completions);
|
||||
return new ClangAssistProposal(m_positionForProposal, model);
|
||||
}
|
||||
@@ -601,9 +601,8 @@ TextEditor::IAssistProposal *ClangCompletionAssistProcessor::createProposal(
|
||||
IAssistProposal *ClangCompletionAssistProcessor::createFunctionHintProposal(
|
||||
const ClangBackEnd::CodeCompletions &completions) const
|
||||
{
|
||||
auto *model = new ClangFunctionHintModel(completions);
|
||||
auto *proposal = new FunctionHintProposal(m_positionForProposal, model);
|
||||
return proposal;
|
||||
TextEditor::FunctionHintProposalModelPtr model(new ClangFunctionHintModel(completions));
|
||||
return new FunctionHintProposal(m_positionForProposal, model);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user