0007179: Select an existing person causes crash in searchfilter
This commit is contained in:
parent
68c0615bc4
commit
aad7b15a47
@ -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,6 +33,9 @@ class SearchFilter(object):
|
|||||||
self.invert = invert
|
self.invert = invert
|
||||||
|
|
||||||
def match(self, handle, db):
|
def match(self, handle, db):
|
||||||
|
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)
|
return self.invert ^ (self.func(handle).upper().find(self.text) != -1)
|
||||||
|
|
||||||
class ExactSearchFilter(SearchFilter):
|
class ExactSearchFilter(SearchFilter):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user