Review Request 121480: use QCollator instead of KStringHandler

Mark Gaiser markg85 at gmail.com
Sat Dec 13 21:54:55 GMT 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/121480/#review71936
-----------------------------------------------------------


Hi,

I invite you to read my blog post about exactly this subject [1]. The simple conclusion: QCollatorSortKey is faster in all cases even with bookkeeping.

As you probably know, a lot of effort has been spend by numerous people to make specifically the sorting operation faster. That didn't change KStringHandler because there was no successor for it at that time. The work for QCollator was known back then and it was remain to be seen if it would be a replacement for KStringHandler. Just using QCollator is the most horrible option when it comes to performace.

I would really recommend against moving to just QCollator. If you move to those classes, use QCollatorSortKey.

[1] http://kdeblog.mageprojects.com/2014/07/06/natural-string-sorting-an-in-depth-analysis/

- Mark Gaiser


On dec 13, 2014, 8:13 p.m., Emmanuel Pescosta wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/121480/
> -----------------------------------------------------------
> 
> (Updated dec 13, 2014, 8:13 p.m.)
> 
> 
> Review request for Dolphin.
> 
> 
> Repository: kde-baseapps
> 
> 
> Description
> -------
> 
> Port away from KStringHandler naturalCompare to QCollator compare.
> 
> Make use of the QCollator instance (m_collator) in nameRoleGroups instead of using QString::localeAwareCompare (uses QCollator internally) to realise a locale aware less than.
> 
> We don't need the m_caseSensitivity anymore, because the QCollator instance also holds this information.
> 
> Removed the KFileItem::name to lower conversion because this makes the case sensitive fallback sorting in stringCompare useless.
> 
> (This patch doesn't make use of QCollatorSortKey)
> 
> 
> Diffs
> -----
> 
>   dolphin/src/kitemviews/kfileitemmodel.h d98d453 
>   dolphin/src/kitemviews/kfileitemmodel.cpp 711b079 
> 
> Diff: https://git.reviewboard.kde.org/r/121480/diff/
> 
> 
> Testing
> -------
> 
> Natural sorting works
> 
> 
> Thanks,
> 
> Emmanuel Pescosta
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20141213/bb5d445e/attachment.htm>


More information about the kfm-devel mailing list