7179: Select an existing person causes crash in searchfilter

refix, aplay only to Windows
This commit is contained in:
Josip 2014-01-06 21:08:40 +01:00
parent 568b4ee4a4
commit bfbf5d01f4

View File

@ -24,6 +24,8 @@
Package providing filtering framework for GRAMPS. Package providing filtering framework for GRAMPS.
""" """
from gramps.gen.constfunc import win
class SearchFilter(object): class SearchFilter(object):
def __init__(self, func, text, invert): def __init__(self, func, text, invert):
self.func = func self.func = func
@ -31,7 +33,10 @@ class SearchFilter(object):
self.invert = invert self.invert = invert
def match(self, handle, db): def match(self, handle, db):
return self.invert ^ (self.func(handle).upper().find(str(self.text)) != -1) if win():
return self.invert ^ (self.func(handle).upper().find(str(self.text)) != -1)
else:
return self.invert ^ (self.func(handle).upper().find(self.text) != -1)
class ExactSearchFilter(SearchFilter): class ExactSearchFilter(SearchFilter):
def __init__(self, func, text, invert): def __init__(self, func, text, invert):