<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="http://git.reviewboard.kde.org/r/104762/">http://git.reviewboard.kde.org/r/104762/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On April 27th, 2012, 7:43 p.m., <b>Mark Gaiser</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<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 Nancy,
I was just playing with time representing stuff using the javascript Date and came up with this very short example that does the exact same :)
onCurrentTimeChanged: {
var dateTimeObject = new Date(0, 0, 0, 0, 0, currentTime, 0)
mediaController.curMediaTime = Qt.formatTime(dateTimeObject, "hh:mm:ss")
}
What i'm doing above is simply initializing the Date object with 0 values and only fill in the seconds. In my test the date object just takes that. Then i'm using Qt.formatTime to format the date object into a nice string. Here is the documentation for both:
Date: http://www.w3schools.com/jsref/jsref_obj_date.asp
Qt.formatTime: http://qt-project.org/doc/qt-4.8/qml-qt.html#formatTime-method (scroll up a little)
You can try and replace the current onCurrentTimeChanged with the example from above, I haven't tested this on your QML file but it should just work.
I hope it works since it seems nicely cleaned up to me. This also makes it a lot easier to change the displayed time format :)
Note: i'm not the author of the mediacenter stuff so someone else should decide if this is ok.</pre>
</blockquote>
</blockquote>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Thanks for the suggestion:)
It absolutely works fine. Just little modification in code since current time is in miliseconds
onCurrentTimeChanged: {
var dateTimeObject = new Date(0, 0, 0, 0, 0, 0, currentTime)
mediaController.curMediaTime = Qt.formatTime(dateTimeObject, "hh:mm:ss")
}
Nancy please update the code and upload the updated diff.</pre>
<br />
<p>- Sinny</p>
<br />
<p>On April 27th, 2012, 5:28 p.m., nancy kumari wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Plasma.</div>
<div>By nancy kumari.</div>
<p style="color: grey;"><i>Updated April 27, 2012, 5:28 p.m.</i></p>
<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;">Displaying playing media time in correct format. previously when value of hour, minute or second was less than 10, then it was displaying in single digit format(0:13:5). Now it displays in proper format(00:13:05).</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </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;">Working fine.</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>shells/newshell/package/contents/ui/mediacenter.qml <span style="color: grey">(11423db)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/104762/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>