<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/110836/">http://git.reviewboard.kde.org/r/110836/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On June 5th, 2013, 10:35 p.m. UTC, <b>David Gil Oliva</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="http://git.reviewboard.kde.org/r/110836/diff/1/?file=148651#file148651line275" style="color: black; font-weight: bold; text-decoration: underline;">kio/kio/slavebase.cpp</a>
<span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">SlaveBase::~SlaveBase()</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">274</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="n">ms</span> <span class="o">=</span> <span class="mi">1000</span> <span class="o">*</span> <span class="n">qMax</span><span class="o"><</span><span class="kt"><span class="hl">time_</span>t</span><span class="o">></span><span class="p">(</span><span class="n">d</span><span class="o">-></span><span class="n">timeout</span> <span class="o">-</span> <span class="n"><span class="hl">t</span>ime</span><span class="p">(</span><span class="mi"><span class="hl">0</span></span><span class="p">),</span> <span class="mi">1</span><span class="p">);</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">272</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="n">ms</span> <span class="o">=</span> <span class="mi">1000</span> <span class="o">*</span> <span class="n">qMax</span><span class="o"><</span><span class="kt"><span class="hl">in</span>t</span><span class="o">></span><span class="p">(</span><span class="n">d</span><span class="o">-></span><span class="n">timeout</span> <span class="o">-</span> <span class="n"><span class="hl">QDateTime</span></span><span class="o"><span class="hl">::</span></span><span class="n"><span class="hl">currentDateT</span>ime</span><span class="p">(<span class="hl">).</span></span><span class="n"><span class="hl">toTime_t</span></span><span class="p"><span class="hl">(</span>),</span> <span class="mi">1</span><span class="p">);</span></pre></td>
</tr>
</tbody>
</table>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">AFAIK, time_t can be either a given moment in time (say 2013-06-06, 00:00) or an elapsed time (say 136 seconds).
On the other hand, QDateTime can only be a given moment in time. That's why I try to transform the time_t of elapsed time to integers and work with seconds.
I'll try to stick with QDateTime and compute the timeouts using other means.</pre>
</blockquote>
</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Well time_t is always an elapsed time, but usually since the epoch (1970) :-)
But yeah, I know what you mean, it can also be used as an elapsed time since some other starting time.
But I don't get it. From the calculation above (d->timeout - time(0)) I conclude that d->timeout is actually an absolute time (i.e. since the epoch). Otherwise this substraction makes no sense at all. So surely QDateTime::msecsTo() would be fine here?
The name "timeout" is just very very confusing in the existing code, that's for sure. It's not a duration AFAICS, it's the absolute time at which we'll "get a timeout".</pre>
<br />
<p>- David</p>
<br />
<p>On June 5th, 2013, 11:19 a.m. UTC, David Gil Oliva wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://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 KDE Frameworks.</div>
<div>By David Gil Oliva.</div>
<p style="color: grey;"><i>Updated June 5, 2013, 11:19 a.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;">Port time_t to QDateTime in SlaveBase (KIO)</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;">It builds.</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>kio/kio/slavebase.cpp <span style="color: grey">(e5333cfff24d0fdb3eb7f123413e8fb80e504d37)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/110836/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>