Merge remote-tracking branch 'origin/10.0' into 11.0

Change-Id: I27e2c1c764f955d14bfece6cd580b4c2d2988396
This commit is contained in:
Eike Ziller
2023-05-25 08:29:27 +02:00
4 changed files with 33 additions and 23 deletions

View File

@@ -186,26 +186,26 @@ void CodeAssistantPrivate::requestProposal(AssistReason reason,
IAssistProcessor *processor = provider->createProcessor(assistInterface.get());
processor->setAsyncCompletionAvailableHandler([this, reason, processor](
IAssistProposal *newProposal) {
if (processor == m_processor) {
invalidateCurrentRequestData();
if (processor->needsRestart() && m_receivedContentWhileWaiting) {
delete newProposal;
m_receivedContentWhileWaiting = false;
requestProposal(reason, m_assistKind, m_requestProvider);
} else {
displayProposal(newProposal, reason);
if (processor->running())
m_processor = processor;
else
emit q->finished();
}
}
if (!processor->running()) {
// do not delete this processor directly since this function is called from within the processor
QMetaObject::invokeMethod(QCoreApplication::instance(), [processor] {
delete processor;
}, Qt::QueuedConnection);
}
if (processor != m_processor)
return;
invalidateCurrentRequestData();
if (processor->needsRestart() && m_receivedContentWhileWaiting) {
delete newProposal;
m_receivedContentWhileWaiting = false;
requestProposal(reason, m_assistKind, m_requestProvider);
} else {
displayProposal(newProposal, reason);
if (processor->running())
m_processor = processor;
else
emit q->finished();
}
});
if (IAssistProposal *newProposal = processor->start(std::move(assistInterface)))