daysmodel: Fix event dot color for first day in calendar grid

Original commit message(s)

  • daysmodel: Fix event dot color for first day in calendar grid

When parent row is 0, internalId of child indexes collides with the nullptr sentinel used for top-level indexes, causing parent() to return invalid. This breaks data() lookups for children of the first day, so eventColor role is never returned, falling back to blue highlight color.

Use parent.row() + 1 (1-based offset) as internalId to avoid the collision with 0.

Reason for the change

As described in commit message.

Test plan

I am not certain how to add a test, so I only applied the fix on my machine.

Reproduction steps:

  1. Install merkuro, kdepim-addons
  2. Add some events to the calendar in merkuro calendar, on the first day displayed in calendar widget (April 27th in my screenshot)
  3. Observe the event indicator dot color.
  4. Before: The default color (blue)
  5. After: Calendar color (orange in my case)

Please feel free to add an automatic test if needed.

Screenshots or screen recordings

Before After
Screenshot_20260514_105934 Screenshot_20260514_105759.png

Bugs fixed

Searched in Bugzilla. Bug not reported before.

Merge request reports

Loading