<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/118277/">https://git.reviewboard.kde.org/r/118277/</a>
     </td>
    </tr>
   </table>
   <br />





 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">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?</pre>
 <br />









<p>- Mark Gaiser</p>


<br />
<p>On May 23rd, 2014, 3:22 p.m. UTC, Martin Klapetek wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Plasma.</div>
<div>By Martin Klapetek.</div>


<p style="color: grey;"><i>Updated May 23, 2014, 3:22 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
plasma-framework
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">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).</pre>
  </td>
 </tr>
</table>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>src/declarativeimports/calendar/qml/DayDelegate.qml <span style="color: grey">(552769c)</span></li>

 <li>src/declarativeimports/calendar/qml/DaysCalendar.qml <span style="color: grey">(6054a9d)</span></li>

 <li>src/declarativeimports/calendar/qml/MonthView.qml <span style="color: grey">(e064f01)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/118277/diff/" style="margin-left: 3em;">View Diff</a></p>







  </td>
 </tr>
</table>








  </div>
 </body>
</html>