aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/codeassist
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2022-07-20 19:03:10 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2022-08-01 14:47:42 +0000
commitbc8ebd3bc73501c7c51fbb00366d4211ccba6d5a (patch)
tree4e3b9a341630b20828c24d46f9b2003dd98a45c6 /src/plugins/texteditor/codeassist
parent1697f604ed3d88b69ac5f357b34e9d5eaf95c15c (diff)
CodeAssistant: Avoid using sender()
Change-Id: I8483b368ebf5dca684d817390e1138362bf11d6f Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Diffstat (limited to 'src/plugins/texteditor/codeassist')
-rw-r--r--src/plugins/texteditor/codeassist/codeassistant.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/texteditor/codeassist/codeassistant.cpp b/src/plugins/texteditor/codeassist/codeassistant.cpp
index d0e5d37812..c6ecaa4de7 100644
--- a/src/plugins/texteditor/codeassist/codeassistant.cpp
+++ b/src/plugins/texteditor/codeassist/codeassistant.cpp
@@ -240,10 +240,10 @@ void CodeAssistantPrivate::requestProposal(AssistReason reason,
m_requestRunner = new ProcessorRunner;
m_runnerConnection = connect(m_requestRunner, &ProcessorRunner::finished,
- this, [this, reason](){
+ this, [this, reason, sender = m_requestRunner] {
// Since the request runner is a different thread, there's still a gap in which the
// queued signal could be processed after an invalidation of the current request.
- if (!m_requestRunner || m_requestRunner != sender())
+ if (!m_requestRunner || m_requestRunner != sender)
return;
IAssistProposal *proposal = m_requestRunner->proposal();
@@ -264,7 +264,7 @@ void CodeAssistantPrivate::requestProposal(AssistReason reason,
IAssistProposal *newProposal) {
if (!processor->running()) {
// do not delete this processor directly since this function is called from within the processor
- QMetaObject::invokeMethod(QCoreApplication::instance(), [processor]() {
+ QMetaObject::invokeMethod(QCoreApplication::instance(), [processor] {
delete processor;
}, Qt::QueuedConnection);
}