Skip to content

Hide fields, to enforce uniform use of setFieldDirty()

Merge requests !44 (merged) and !43 (merged) dealt with situations where some Todo fields were changed, but not marked as dirty. Bug https://bugs.kde.org/show_bug.cgi?id=389336 describes the converse problem, where fields that did not change are marked as dirty.

This MR proposes a less fallible interface that hides the Todo fields behind setters that enforce consistent behaviour.

Notes:

  • The unpatched code assigns to mDtRecurrence in three places but only marks it dirty in one.
  • I think deserialize() is the only function that was correct in not dirtying any fields (hence the resetDirtyFields() in the patch) but I'd appreciate second opinions.

If this makes software engineering sense, I'd make similar changes to the other incidence classes.

Merge request reports