summary refs log tree commit diff
path: root/src/CompletionProxyModel.cpp
diff options
context:
space:
mode:
authorJedi18 <targetakhil@gmail.com>2021-03-07 00:18:24 +0530
committerJedi18 <targetakhil@gmail.com>2021-03-07 00:18:24 +0530
commit8870455f9dd6463f9b8ef04516d69efef3c6287d (patch)
tree475f1eef9c90c1149e8dd8cf6bdf594be606c949 /src/CompletionProxyModel.cpp
parentchanged bottomToTop to true and renamed textWidth to textHeight (diff)
downloadnheko-8870455f9dd6463f9b8ef04516d69efef3c6287d.tar.xz
change allowed mistakes, fix minor style issues, remove old completer function from inputbar
Diffstat (limited to '')
-rw-r--r--src/CompletionProxyModel.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/CompletionProxyModel.cpp b/src/CompletionProxyModel.cpp

index fa5b3c2d..35b8d0a9 100644 --- a/src/CompletionProxyModel.cpp +++ b/src/CompletionProxyModel.cpp
@@ -6,8 +6,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+|-"); @@ -59,7 +62,7 @@ CompletionProxyModel::invalidate() { auto key = searchString.toUcs4(); beginResetModel(); - mapping = trie_.search(key, 7); + mapping = trie_.search(key, 7, maxMistakes_); endResetModel(); std::string temp;