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

@@ -216,8 +216,10 @@ void BasicProposalItemListModel::filter(const QString &prefix)
}
}
bool BasicProposalItemListModel::isSortable() const
bool BasicProposalItemListModel::isSortable(const QString &prefix) const
{
Q_UNUSED(prefix);
if (m_currentItems.size() < kMaxSort)
return true;
return false;