[kmail2] [Bug 484119] Smart dates in message list still show "today" for messages received yesterday

Christoph Erhardt bugzilla_noreply at kde.org
Fri Oct 4 21:32:05 BST 2024


https://bugs.kde.org/show_bug.cgi?id=484119

--- Comment #5 from Christoph Erhardt <kde at sicherha.de> ---
I'm not familiar with the KDE PIM code base, but after digging into it I might
have a lead.

`MessageList::Core::Manager` - which has singleton characteristics - holds a
`MessageCore::DateFormatter` object in a member variable named
`mDateFormatter`:
https://invent.kde.org/pim/messagelib/-/blob/46b22c6d85a63ae70f6822078b4846ec548d70cc/messagelist/src/core/manager.cpp#L33

`MessageCore::DateFormatterPrivate` has a member variable named
`mTodayOneSecondBeforeMidnight`, which holds the reference time point for
'today' (and, by extension, for 'yesterday'). That variable is initialised
lazily exactly once:
https://invent.kde.org/pim/messagelib/-/blob/46b22c6d85a63ae70f6822078b4846ec548d70cc/messagecore/src/utils/dateformatter.cpp#L161

So, in summary, we have a singleton object holding a long-lived date-formatter
object containing a reference time point that never gets updated over the
lifetime of the application.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Kdepim-bugs mailing list