forked from qt-creator/qt-creator
CppEditor: Reset completion view before aborting
...otherwise subsequent events (e.g. Return) might trigger functions operating on an invalid model index (see activateCurrentProposalItem). Task-number: QTCREATORBUG-10589 Change-Id: Ib3e37c8c85c882135970d5d9418d6e69917494c6 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
@@ -443,6 +443,7 @@ bool GenericProposalWidget::updateAndCheck(const QString &prefix)
|
|||||||
if (d->m_model->size() == 0
|
if (d->m_model->size() == 0
|
||||||
|| (!d->m_model->keepPerfectMatch(d->m_reason)
|
|| (!d->m_model->keepPerfectMatch(d->m_reason)
|
||||||
&& isPerfectMatch(prefix, d->m_model))) {
|
&& isPerfectMatch(prefix, d->m_model))) {
|
||||||
|
d->m_completionListView->reset();
|
||||||
abort();
|
abort();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -474,6 +475,7 @@ bool GenericProposalWidget::updateAndCheck(const QString &prefix)
|
|||||||
if (d->m_model->size() == 1) {
|
if (d->m_model->size() == 1) {
|
||||||
IAssistProposalItem *item = d->m_model->proposalItem(0);
|
IAssistProposalItem *item = d->m_model->proposalItem(0);
|
||||||
if (item->implicitlyApplies()) {
|
if (item->implicitlyApplies()) {
|
||||||
|
d->m_completionListView->reset();
|
||||||
abort();
|
abort();
|
||||||
emit proposalItemActivated(item);
|
emit proposalItemActivated(item);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user