Review Request 112797: Bring back KStringHandler::naturalCompare()

Mark Gaiser markg85 at gmail.com
Wed Sep 18 17:40:32 UTC 2013



> On Sept. 18, 2013, 5:23 p.m., Mark Gaiser wrote:
> > Posting the same here as i just said in your other review request. (I didn't see this one)
> > Idea: restore naturalCompare as it was and add a "collatorNaturalCompare" that is taking the QCollator route. That way it's easily testable as well.
> > 
> > I think we can all agree on that, right?
> 
> Aleix Pol Gonzalez wrote:
>     ** posting again as well... **
>     
>     I don't think creating such function would be a good thing because it means using QCollator the wrong way. I much rather prefer working on tools to properly use QCollator, for example by making it possible to sort things with the sort key instead of QCollator::compare which will be the place where we can actually test performance.

True, but then it can't be used as a 1 on 1 replacement. Since QCollatorSortKey would first have to be generated for every string and stored in the list that is to be sorted (That would be the ItemData struct http://quickgit.kde.org/?p=kde-baseapps.git&a=blob&h=841016138c4a67691177ae9d759eae6399adc762&hb=7dde35ccb97ac2958e45fe6b0759901e02d5e5e3&f=dolphin%2Fsrc%2Fkitemviews%2Fkfileitemmodel.h from line 299). But yeah, that does seem like a very nice idea and close to an idea that was floating the kfm-devel list ~1 year ago which also involved adding some "precompiled" sort data in that very same structure to speed up sorting.

Anyway, +1 from me but someone else must give a ship it.


- Mark


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/112797/#review40289
-----------------------------------------------------------


On Sept. 18, 2013, 4:55 p.m., Aleix Pol Gonzalez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/112797/
> -----------------------------------------------------------
> 
> (Updated Sept. 18, 2013, 4:55 p.m.)
> 
> 
> Review request for KDE Frameworks, Frank Reininghaus and Mark Gaiser.
> 
> 
> Description
> -------
> 
> Apparently there's people who still want to have it. Leave it in KCoreAddons for the moment, until we decide that it can be replaced for good by QCollator.
> 
> 
> Diffs
> -----
> 
>   tier1/kcoreaddons/autotests/kstringhandlertest.cpp 93da351 
>   tier1/kcoreaddons/src/lib/text/kstringhandler.h 442b97a 
>   tier1/kcoreaddons/src/lib/text/kstringhandler.cpp ea3bbf5 
> 
> Diff: http://git.reviewboard.kde.org/r/112797/diff/
> 
> 
> Testing
> -------
> 
> Builds, tests pass.
> 
> 
> Thanks,
> 
> Aleix Pol Gonzalez
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20130918/68488f83/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list