Merge branch 'quickswitcher_qml' of git://github.com/Jedi18/nheko into Jedi18-quickswitcher_qml

This commit is contained in:
Nicolas Werner 2021-03-13 23:45:05 +01:00
commit 7a356f3832
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
18 changed files with 323 additions and 272 deletions

View file

@ -10,8 +10,11 @@
#include "Logging.h"
#include "Utils.h"
CompletionProxyModel::CompletionProxyModel(QAbstractItemModel *model, QObject *parent)
CompletionProxyModel::CompletionProxyModel(QAbstractItemModel *model,
int max_mistakes,
QObject *parent)
: QAbstractProxyModel(parent)
, maxMistakes_(max_mistakes)
{
setSourceModel(model);
QRegularExpression splitPoints("\\s+|-");
@ -63,7 +66,7 @@ CompletionProxyModel::invalidate()
{
auto key = searchString.toUcs4();
beginResetModel();
mapping = trie_.search(key, 7);
mapping = trie_.search(key, 7, maxMistakes_);
endResetModel();
std::string temp;