Commit cbcfb835 authored by Dennis Baurichter's avatar Dennis Baurichter

Search: ExistingFilter: Invalidate old cache

Fixes #70
parent 681975c0
......@@ -83,6 +83,7 @@ class ExistingFilter:
# No additional arguments are required by this generator.
def __init__(s, enumerator):
s._cache=None
s._cache_epoch=caching.get_epoch()
s._enumerator=enumerator
## \brief Clears internal cache in this filter and all predecessors
......@@ -93,10 +94,14 @@ class ExistingFilter:
## \brief Request method as specified in
# \ref _fn_99-meta_doc_concepts_search-engines_md.
def request(s, **kwargs):
if caching.get_epoch()>s._cache_epoch:
s.invalidateCache()
allItems=s._enumerator.request(**kwargs)
if s._cache==None:
s._cache=set()
s._cache_epoch=caching.get_epoch()
for item in allItems:
if item.folder.archived or item.folder.lost: continue
s._cache.add(item)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment