Review Request 128574: Enable natural sorting on QCollator in KDirSortFilterProxyModel

Mark Gaiser markg85 at gmail.com
Thu Apr 27 23:29:37 UTC 2017



> On apr 27, 2017, 7:58 p.m., Elvis Angelaccio wrote:
> > src/filewidgets/kdirsortfilterproxymodel.cpp, lines 79-81
> > <https://git.reviewboard.kde.org/r/128574/diff/1/?file=472751#file472751line79>
> >
> >     Please use `m_collator.setNumericMode(m_naturalSorting);` instead. It would also take care of disabling the natural sorting, if necessary.

What Elvis said. Just replace the if block with that line and it's imho good to go.
+1


- Mark


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


On jan 8, 2017, 4:13 p.m., Mathis Beer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/128574/
> -----------------------------------------------------------
> 
> (Updated jan 8, 2017, 4:13 p.m.)
> 
> 
> Review request for KDE Frameworks, David Faure, Nick Shaforostoff, and Harald Sitter.
> 
> 
> Bugs: 343452
>     https://bugs.kde.org/show_bug.cgi?id=343452
> 
> 
> Repository: kio
> 
> 
> Description
> -------
> 
> KDirSortFilterProxyModel is advertised in the header as performing a "natural sort", ie. "7 8 9 10 11", instead of a lexical "10 11 7 8 9".
> However, as far as I can tell this was never true from the start, since the collator responsible for the actual sorting did not have the requisite numeric mode enabled, and this setting has always been off by default as far back as I can find docs for it (Qt 5.2).
> 
> (Dolphin, which offers "natural sort", did not run into this issue because it does not actually use KDirSortFilterProxyModel.)
> 
> 
> Diffs
> -----
> 
>   src/filewidgets/kdirsortfilterproxymodel.cpp 89505ac 
> 
> Diff: https://git.reviewboard.kde.org/r/128574/diff/
> 
> 
> Testing
> -------
> 
> Create a folder with three images, "File 1.png", "File 10.png", "File 2.png".
> View the folder in Gwenview with sort order set to "Name". The sort order is "File 1.png, File 10.png, File 2.png".
> Apply patch.
> View the folder in Gwenview with sort order set to "Name". The sort order is "File 1.png, File 2.png, File 10.png".
> 
> 
> Thanks,
> 
> Mathis Beer
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20170427/4d312a44/attachment.html>


More information about the Kde-frameworks-devel mailing list