Review Request 118277: [1/2] Make sure we update the calendar on date change
Mark Gaiser
markg85 at gmail.com
Fri May 23 16:02:11 UTC 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/118277/#review58362
-----------------------------------------------------------
Hi Martin,
I would like to suggest a different approach.
1. You want to know the current day (which the model and calendar component don't expose).
2. You want the daysModel data to update when the clock ticks over 12.00 PM into the next day.
My suggestion for 1 is the following:
Expose the _index_ from the daysData model that represents the current day. Note, that index is almost always going to be higher then "today" in the current month. So May 23 will not return 23 due to the last 4 days of april also being in the model. This differs per month obviously so your return index should be <daynumber> + n of last month where n = 4 in this case.
My suggestion for 2 is the following:
Upon Calendar constructing start a timer (in the C++ side) to update the model at midnight. The timer should then call Calendar::updateData which will update everything.
What are your thoughts on this?
- Mark Gaiser
On May 23, 2014, 3:22 p.m., Martin Klapetek wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/118277/
> -----------------------------------------------------------
>
> (Updated May 23, 2014, 3:22 p.m.)
>
>
> Review request for Plasma.
>
>
> Repository: plasma-framework
>
>
> Description
> -------
>
> This is the first part of a fix for updating the calendar properly when date changes (after midnight).
>
> It introduces new property on MonthView - "today". This property is updated by dataengine (or can be a timer too, but we already get signals from dataengine every 30 seconds) and is never updated by the code itself. Furthermore, the DayDelegate is now bound to it, so when "today" changes, the selection rectangle in the calendar should also change. And finally, the selected item in the grid is cleared if MonthView's date property is cleared (which is second part of this patch, to the applet itself).
>
>
> Diffs
> -----
>
> src/declarativeimports/calendar/qml/DayDelegate.qml 552769c
> src/declarativeimports/calendar/qml/DaysCalendar.qml 6054a9d
> src/declarativeimports/calendar/qml/MonthView.qml e064f01
>
> Diff: https://git.reviewboard.kde.org/r/118277/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Martin Klapetek
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20140523/0f55cb20/attachment.html>
More information about the Plasma-devel
mailing list