mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Use case folding instead of lower case for search
This commit is contained in:
parent
777bf9f9f6
commit
ab5f176de0
1 changed files with 3 additions and 3 deletions
|
@ -45,7 +45,7 @@ CompletionProxyModel::CompletionProxyModel(QAbstractItemModel *model,
|
||||||
auto string1 = sourceModel()
|
auto string1 = sourceModel()
|
||||||
->data(sourceModel()->index(i, 0), CompletionModel::SearchRole)
|
->data(sourceModel()->index(i, 0), CompletionModel::SearchRole)
|
||||||
.toString()
|
.toString()
|
||||||
.toLower();
|
.toCaseFolded();
|
||||||
if (!string1.isEmpty()) {
|
if (!string1.isEmpty()) {
|
||||||
trie_.insert<ElementRank::first>(string1.toUcs4(), i);
|
trie_.insert<ElementRank::first>(string1.toUcs4(), i);
|
||||||
insertParts(string1, i);
|
insertParts(string1, i);
|
||||||
|
@ -54,7 +54,7 @@ CompletionProxyModel::CompletionProxyModel(QAbstractItemModel *model,
|
||||||
auto string2 = sourceModel()
|
auto string2 = sourceModel()
|
||||||
->data(sourceModel()->index(i, 0), CompletionModel::SearchRole2)
|
->data(sourceModel()->index(i, 0), CompletionModel::SearchRole2)
|
||||||
.toString()
|
.toString()
|
||||||
.toLower();
|
.toCaseFolded();
|
||||||
if (!string2.isEmpty()) {
|
if (!string2.isEmpty()) {
|
||||||
trie_.insert<ElementRank::first>(string2.toUcs4(), i);
|
trie_.insert<ElementRank::first>(string2.toUcs4(), i);
|
||||||
insertParts(string2, i);
|
insertParts(string2, i);
|
||||||
|
@ -74,7 +74,7 @@ CompletionProxyModel::CompletionProxyModel(QAbstractItemModel *model,
|
||||||
&CompletionProxyModel::newSearchString,
|
&CompletionProxyModel::newSearchString,
|
||||||
this,
|
this,
|
||||||
[this](const QString &s) {
|
[this](const QString &s) {
|
||||||
searchString_ = s.toLower();
|
searchString_ = s.toCaseFolded();
|
||||||
invalidate();
|
invalidate();
|
||||||
},
|
},
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
|
|
Loading…
Reference in a new issue