summary refs log tree commit diff
path: root/src/CompletionProxyModel.h
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-11-20 04:14:19 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2020-11-25 19:05:12 +0100
commit67dcc74c79aebc3d6f117f1cc08a44a778b1192e (patch)
tree5c672bd97328fdf2a800a4fd380cd5e4ed0d062f /src/CompletionProxyModel.h
parentCustom completer filtering (diff)
downloadnheko-67dcc74c79aebc3d6f117f1cc08a44a778b1192e.tar.xz
Simple prefix match for completions
Diffstat (limited to 'src/CompletionProxyModel.h')
-rw-r--r--src/CompletionProxyModel.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/CompletionProxyModel.h b/src/CompletionProxyModel.h
index ee8236e3..2bc22875 100644
--- a/src/CompletionProxyModel.h
+++ b/src/CompletionProxyModel.h
@@ -90,27 +90,27 @@ public:
                   sourceModel()->data(source_left, CompletionModel::SearchRole).toString();
                 auto left2 =
                   sourceModel()->data(source_left, CompletionModel::SearchRole2).toString();
-                auto left = left1.toLower().indexOf(searchString);
+                auto left = (size_t)left1.toLower().indexOf(searchString);
                 // utils::levenshtein_distance(searchString, left1.toLower().toStdString());
                 if (!left2.isEmpty()) {
                         // left = std::min(
                         //  utils::levenshtein_distance(searchString,
                         //  left2.toLower().toStdString()), left);
-                        left = std::min(left2.toLower().indexOf(searchString), left);
+                        left = std::min((size_t)left2.toLower().indexOf(searchString), left);
                 }
 
                 auto right1 =
                   sourceModel()->data(source_right, CompletionModel::SearchRole).toString();
                 auto right2 =
                   sourceModel()->data(source_right, CompletionModel::SearchRole2).toString();
-                auto right = right1.toLower().indexOf(searchString);
+                auto right = (size_t)right1.toLower().indexOf(searchString);
                 // auto right =
                 //  utils::levenshtein_distance(searchString, right1.toLower().toStdString());
                 if (!right2.isEmpty()) {
                         // right = std::min(
                         //  utils::levenshtein_distance(searchString,
                         //  right2.toLower().toStdString()), right);
-                        right = std::min(right2.toLower().indexOf(searchString), right);
+                        right = std::min((size_t)right2.toLower().indexOf(searchString), right);
                 }
 
                 return left < right;