Improve sorting a bit and fix some bugs in edge cases
makes nheko appear at the top, if you search for it as well as TWIM match the twim room
This commit is contained in:
parent
28074794e7
commit
7d6bd67615
2 changed files with 57 additions and 40 deletions
|
|
@ -28,12 +28,15 @@ CompletionProxyModel::CompletionProxyModel(QAbstractItemModel *model,
|
|||
->data(sourceModel()->index(i, 0), CompletionModel::SearchRole)
|
||||
.toString()
|
||||
.toLower();
|
||||
trie_.insert(string1.toUcs4(), i);
|
||||
if (!string1.isEmpty())
|
||||
trie_.insert(string1.toUcs4(), i);
|
||||
|
||||
auto string2 = sourceModel()
|
||||
->data(sourceModel()->index(i, 0), CompletionModel::SearchRole2)
|
||||
.toString()
|
||||
.toLower();
|
||||
if (!string2.isEmpty())
|
||||
trie_.insert(string2.toUcs4(), i);
|
||||
}
|
||||
|
||||
// insert the partial matches
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue