aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/codeassist
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2022-07-03 10:40:38 +0300
committerOrgad Shaneh <orgads@gmail.com>2022-07-04 04:42:22 +0000
commit4180e1b84f43cc39119e003457f76be518588107 (patch)
treecb69d2bebd8b80007c5a138d265b244127196772 /src/plugins/texteditor/codeassist
parent866f16adb1aaff5c8e2d4a61625dc480e432cd0d (diff)
CodeAssist: Fix Coverity issues
* Initialize m_reason in IAssistProposal. * Remove superfluous null validations. Change-Id: Icb9b7a7a98db719540586142e30be75f37a4ab92 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/texteditor/codeassist')
-rw-r--r--src/plugins/texteditor/codeassist/codeassistant.cpp4
-rw-r--r--src/plugins/texteditor/codeassist/iassistproposal.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/texteditor/codeassist/codeassistant.cpp b/src/plugins/texteditor/codeassist/codeassistant.cpp
index 50b5626ca7..22c937ac1c 100644
--- a/src/plugins/texteditor/codeassist/codeassistant.cpp
+++ b/src/plugins/texteditor/codeassist/codeassistant.cpp
@@ -270,13 +270,13 @@ void CodeAssistantPrivate::requestProposal(AssistReason reason,
if (processor != m_asyncProcessor)
return;
invalidateCurrentRequestData();
- if (processor && processor->needsRestart() && m_receivedContentWhileWaiting) {
+ if (processor->needsRestart() && m_receivedContentWhileWaiting) {
delete newProposal;
m_receivedContentWhileWaiting = false;
requestProposal(reason, m_assistKind, m_requestProvider);
} else {
displayProposal(newProposal, reason);
- if (processor && processor->running())
+ if (processor->running())
m_asyncProcessor = processor;
else
emit q->finished();
diff --git a/src/plugins/texteditor/codeassist/iassistproposal.h b/src/plugins/texteditor/codeassist/iassistproposal.h
index 1393cbab83..feb92caf9f 100644
--- a/src/plugins/texteditor/codeassist/iassistproposal.h
+++ b/src/plugins/texteditor/codeassist/iassistproposal.h
@@ -65,7 +65,7 @@ protected:
int m_basePosition;
bool m_isFragile = false;
bool m_supportsPrefix = true;
- AssistReason m_reason;
+ AssistReason m_reason = IdleEditor;
};
} // TextEditor