forked from qt-creator/qt-creator
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>
This commit is contained in:
committed by
Orgad Shaneh
parent
866f16adb1
commit
4180e1b84f
@@ -270,13 +270,13 @@ void CodeAssistantPrivate::requestProposal(AssistReason reason,
|
|||||||
if (processor != m_asyncProcessor)
|
if (processor != m_asyncProcessor)
|
||||||
return;
|
return;
|
||||||
invalidateCurrentRequestData();
|
invalidateCurrentRequestData();
|
||||||
if (processor && processor->needsRestart() && m_receivedContentWhileWaiting) {
|
if (processor->needsRestart() && m_receivedContentWhileWaiting) {
|
||||||
delete newProposal;
|
delete newProposal;
|
||||||
m_receivedContentWhileWaiting = false;
|
m_receivedContentWhileWaiting = false;
|
||||||
requestProposal(reason, m_assistKind, m_requestProvider);
|
requestProposal(reason, m_assistKind, m_requestProvider);
|
||||||
} else {
|
} else {
|
||||||
displayProposal(newProposal, reason);
|
displayProposal(newProposal, reason);
|
||||||
if (processor && processor->running())
|
if (processor->running())
|
||||||
m_asyncProcessor = processor;
|
m_asyncProcessor = processor;
|
||||||
else
|
else
|
||||||
emit q->finished();
|
emit q->finished();
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ protected:
|
|||||||
int m_basePosition;
|
int m_basePosition;
|
||||||
bool m_isFragile = false;
|
bool m_isFragile = false;
|
||||||
bool m_supportsPrefix = true;
|
bool m_supportsPrefix = true;
|
||||||
AssistReason m_reason;
|
AssistReason m_reason = IdleEditor;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // TextEditor
|
} // TextEditor
|
||||||
|
|||||||
Reference in New Issue
Block a user