Removed casefold() function call when using a custom filter.

This commit is contained in:
Antoni Boucher 2015-07-12 20:29:40 -04:00
parent 1b24cfd618
commit 5bca951c21
2 changed files with 3 additions and 4 deletions

View File

@ -140,13 +140,12 @@ class CompletionFilterModel(QSortFilterProxyModel):
if not self.pattern:
return True
pattern = self.pattern.casefold()
try:
return self.srcmodel.custom_filter(pattern, row, parent)
return self.srcmodel.custom_filter(self.pattern, row, parent)
except NotImplementedError:
if not data:
return False
return pattern in data.casefold()
return self.pattern.casefold() in data.casefold()
def intelligentLessThan(self, lindex, rindex):
"""Custom sorting implementation.

View File

@ -107,7 +107,7 @@ class UrlCompletionModel(base.BaseCompletionModel):
index1 = self.index(row, 1, parent)
url = self.data(index0) or ''
title = self.data(index1) or ''
return pattern in url.casefold() or pattern in title.casefold()
return pattern.casefold() in url.casefold() or pattern.casefold() in title.casefold()
@config.change_filter('completion', 'timestamp-format')
def reformat_timestamps(self):