completion: Match case-insensitively.

This commit is contained in:
Florian Bruhin 2014-10-19 23:04:26 +02:00
parent e3e1382ccd
commit 8dffceeb2a
2 changed files with 3 additions and 1 deletions

View File

@ -59,6 +59,8 @@ class BaseCompletionModel(QStandardItemModel):
marks = []
if not needle:
return marks
needle = needle.casefold()
haystack = haystack.casefold()
while True:
pos1 = haystack.find(needle, pos2)
if pos1 == -1:

View File

@ -141,7 +141,7 @@ class CompletionFilterModel(QSortFilterProxyModel):
# TODO more sophisticated filtering
if not self._pattern:
return True
return self._pattern in data
return self._pattern.casefold() in data.casefold()
def lessThan(self, lindex, rindex):
"""Custom sorting implementation.