Allow generic component names for simplified prefilters

This commit is contained in:
Unrud 2017-09-07 20:26:31 +02:00
parent 81c596eb1d
commit 85d80fe9fc

View File

@ -600,12 +600,14 @@ def simplify_prefilters(filters):
simple = False
continue
tag = comp_filter.get("name").upper()
if (tag not in ("VTODO", "VEVENT", "VJOURNAL") or comp_filter.find(
_tag("C", "is-not-defined")) is not None):
if comp_filter.find(_tag("C", "is-not-defined")) is not None:
simple = False
continue
simple &= len(comp_filter) <= 1
for time_filter in comp_filter:
if tag not in ("VTODO", "VEVENT", "VJOURNAL"):
simple = False
break
if time_filter.tag != _tag("C", "time-range"):
simple = False
continue