<div dir="ltr">On Fri, Jul 19, 2013 at 1:27 PM, Frank Reininghaus <span dir="ltr"><<a href="mailto:frank78ac@googlemail.com" target="_blank">frank78ac@googlemail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
<br>
2013/7/19 Aleix Pol:<br>
<div class="im">> Hi,<br>
> I was looking at that task in the Qt5 epics list and I didn't understand it<br>
> fully.<br>
><br>
> contribute natural-comparison to Qt5 (see KStringHandler). In Qt there is<br>
> naturalCompare function but private and not as good as from KStringHandler.<br>
> Thiago says: add the feature to QCollator.<br>
<br>
</div>Could you explain why KStringHandler::naturalCompare() is better than<br>
what QCollator offers?<br>
<br>
QCollator has the very nice feature<br>
<br>
QByteArray QCollator::sortKey(const QString &string)<br>
<br>
which allows to calculate the 'sortKey' for each string once, and then<br>
use these for the sorting. This means that we could sort a large list<br>
of strings with O(N*log(N)) cheap comparisons of QByteArrays, rather<br>
than the same amount of very expensive<br>
KStringHandler::naturalCompare() calls.<br>
<br>
At the moment, KStringHandler::naturalCompare() is the major<br>
bottleneck in Dolphin when you open a very large directory. If we<br>
could use QCollator, that problem could be solved quite easily.<br>
<br>
Cheers,<br>
Frank<br>
</blockquote></div><br></div><div class="gmail_extra">Hi,</div><div class="gmail_extra">I was just the task explaination [1]...</div><div class="gmail_extra"><br></div><div class="gmail_extra">Aleix</div><div class="gmail_extra">

<br></div><div class="gmail_extra">[1] <a href="http://community.kde.org/Frameworks/Epics/Contributions_to_Qt5">http://community.kde.org/Frameworks/Epics/Contributions_to_Qt5</a></div></div>