Improve code-assist API isSortable

Now IGenericProposalModel::isSortable also takes the current prefix
as a parameter. This is particularly useful for cases like in the C++
completion: For global completions it will only sort if there's
already a content prefix - Notice, however, that the "sorting threshold"
for a maximum number of items is still kept in IGenericProposalModel::sort.

Task-number: QTCREATORBUG-6404
Change-Id: I3c2f282aa565287b8b4989930b6a27093862ef25
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
Leandro Melo
2012-02-10 12:58:05 +01:00
parent ef979ae7f4
commit 70b64280ee
7 changed files with 17 additions and 13 deletions

View File

@@ -437,7 +437,7 @@ bool GenericProposalWidget::updateAndCheck(const QString &prefix)
abort();
return false;
}
if (d->m_model->isSortable())
if (d->m_model->isSortable(prefix))
d->m_model->sort();
d->m_completionListView->reset();