<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/114187/">http://git.reviewboard.kde.org/r/114187/</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;">Some extra comments.
I'm not exactly sure I get your concerns regarding the tr() use, to me it looks like it cover our needs here but I might be missing something.</pre>
<br />
<div>
<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/114187/diff/1/?file=221010#file221010line66" style="color: black; font-weight: bold; text-decoration: underline;">tier1/kcoreaddons/src/lib/util/kformat.h</a>
<span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">66</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="n">class</span> <span class="n">KCOREADDONS_EXPORT</span> <span class="n">KFormat</span> <span class="o">:</span> <span class="n">QObject</span></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">67</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="p">{</span></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">68</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="n">Q_OBJECT</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">In the vein of something used by value and not inheritable it should use Q_DECL_FINAL.</pre>
</div>
<br />
<div>
<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/114187/diff/1/?file=221010#file221010line156" style="color: black; font-weight: bold; text-decoration: underline;">tier1/kcoreaddons/src/lib/util/kformat.h</a>
<span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">156</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="n">virtual</span> <span class="o">~</span><span class="n">KFormat</span><span class="p">();</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Is it really something we want to be able to inherit from? I think Alex's comment about not inheriting from QObject is right, in which case the virtual should be dropped here.
This class really feels like something to be used by value and not inheritable.</pre>
</div>
<br />
<div>
<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/114187/diff/1/?file=221012#file221012line250" style="color: black; font-weight: bold; text-decoration: underline;">tier1/kcoreaddons/src/lib/util/kformatprivate.cpp</a>
<span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">250</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="c1">// Should never reach here</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Definitely Q_ASSERT here. As for the compiler cleverness... depends on the gcc version, and I'm not sure if VS is clever enough for it.</pre>
</div>
<br />
<p>- Kevin Ottens</p>
<br />
<p>On November 28th, 2013, 8 p.m. UTC, John Layt 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, Albert Astals Cid, David Faure, and Kevin Ottens.</div>
<div>By John Layt.</div>
<p style="color: grey;"><i>Updated Nov. 28, 2013, 8 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
kdelibs
</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;">KFormat - Add new KFormat class
KLocale offers a number of extra formatting options not yet available
in Qt. The KFormat class adds these options to KCoreAddons:
* formatByteSize()
* formatDuration()
* formatDecimalDuration()
* formatSpelloutDuration()
* formatRelativeDate()
* formatRelativeDateTime()
The KFormat class can be initialised with any QLocale to use in the
date and number formatting, or the default locale can be easily
accessed via KFormat():
QString result = KFormat().formatDuration(1000);
----------------------------------------
There's a few things that need looking at here. The main one is the translation stuff because I had to convert from using ki18n to tr and it may have lost something in the process. In particular it looks like we'll actually need an en_US translation done to get the plurals right? If we can't make tr() work for these we'll have to move the class into k18n. The second is to look at the formatting options provided and decide if they are actually useful to have. The third is to confirm that the design is OK, I did think about making these simple static methods with an extra parm for QLocale, but I think this approach offers more future flexibility, and writing KFormat().formatDuration() is just as convenient as KFormat::formatDuration().</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;">Autotests copied from KLocale tests and improved.</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>tier1/kcoreaddons/autotests/CMakeLists.txt <span style="color: grey">(c8043576181e7d06663195d017be930d0bdcbde9)</span></li>
<li>tier1/kcoreaddons/autotests/kformattest.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>tier1/kcoreaddons/autotests/kformattest.cpp <span style="color: grey">(PRE-CREATION)</span></li>
<li>tier1/kcoreaddons/src/lib/CMakeLists.txt <span style="color: grey">(638525f7b719bcd0bc1dfdf94debd51296521334)</span></li>
<li>tier1/kcoreaddons/src/lib/util/kformat.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>tier1/kcoreaddons/src/lib/util/kformat.cpp <span style="color: grey">(PRE-CREATION)</span></li>
<li>tier1/kcoreaddons/src/lib/util/kformatprivate.cpp <span style="color: grey">(PRE-CREATION)</span></li>
<li>tier1/kcoreaddons/src/lib/util/kformatprivate_p.h <span style="color: grey">(PRE-CREATION)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/114187/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>