diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-24 16:18:02 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-24 16:18:02 +0200 |
| commit | 5c6a11e72755cc500c77b5fa92dae43ab990f21e (patch) | |
| tree | 3c88c2a4b4c3064b2c32f2d6495d6bfb70618c4c /src/calendarstore.cpp | |
| parent | 53bef55d4d608cd15a30727f6aef7626a1de2120 (diff) | |
| download | qtmaildir-5c6a11e72755cc500c77b5fa92dae43ab990f21e.tar.gz qtmaildir-5c6a11e72755cc500c77b5fa92dae43ab990f21e.zip | |
fix: expand a long dense series completely and flag overrides' own all-day
Diffstat (limited to 'src/calendarstore.cpp')
| -rw-r--r-- | src/calendarstore.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/calendarstore.cpp b/src/calendarstore.cpp index 93f21d4..a9efe8f 100644 --- a/src/calendarstore.cpp +++ b/src/calendarstore.cpp @@ -123,9 +123,11 @@ QDateTime endOf(icalcomponent *c, const QDateTime &start, bool allDay, bool *unk } /// ponytail: iterates from DTSTART rather than icalrecur_iterator_set_start, -/// which is unsupported with COUNT. Capped per series; raise the cap only if -/// a real rule is measured hitting it. -constexpr int kMaxIterations = 10000; +/// which is unsupported with COUNT. The cap guards against a pathological rule +/// (FREQ=SECONDLY over a wide window), not against age: a daily series from +/// 1970 to a 22nd-century window is under 50k steps, well inside 100000. 100k +/// iterator steps is still microseconds, so the cap is not a performance knob. +constexpr int kMaxIterations = 100000; bool overlaps(const QDateTime &start, const QDateTime &end, const QDateTime &from, const QDateTime &to) @@ -336,7 +338,7 @@ QList<Occurrence> occurrences(const QList<CalEvent> &events, for (int o = 0; o < e.overrides.size(); ++o) { const CalOverride &ov = e.overrides[o]; if (!ov.cancelled && overlaps(ov.start, ov.end, from, to)) - result.append({ i, ov.start, ov.end, e.allDay, ov.recurrenceId, true, o }); + result.append({ i, ov.start, ov.end, ov.allDay, ov.recurrenceId, true, o }); } } std::sort(result.begin(), result.end(), |
