From kde-core-devel Tue Aug 18 06:19:56 2009 From: Peter Penz Date: Tue, 18 Aug 2009 06:19:56 +0000 To: kde-core-devel Subject: Re: Review Request: Add global option to turn off "natural sorting" Message-Id: <200908180819.56190.peter.penz () gmx ! at> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=125057648527647 On Tuesday, 18. August 2009 01:48:27 Matthew Woehlke wrote: > (FYI, you don't need to CC me on this list...) > > Peter Penz wrote: > > On Tuesday, 18. August 2009 00:20:47 Matthew Woehlke wrote: > >> While you're looking at this, any chance of fixing natural sorting where > >> it is currently broken? > >> Specifically, sorting of hexadecimal or other > >> base-greater-than-10 numbers? (I have at least one directory of stuff > >> that is base-36 numbering, that sorts very wrongly. Actually, this makes > >> something of an argument for per-directory options...) > > > > Natural sorting is not "broken" in this case. There is no way for the > > compare function to know the semantics of a string: Should F1.jpg be > > handled as a hexadezimal value or not? > > I thought of that, which is why I mentioned it needing to be > per-directory. Nevertheless, I hate to turn off natural sorting > globally, but it's really hard to find the right file in a list like: > > 5GH67I > 6IF732 > 6KW84W > 7FDM86 > 8CFUQR > 10AH2MF > 62DH13 > 74UZGI > EW5YP > U4H3WM > > That's clearly wrong... the order should be: > > EW5YP > 5GH67I > 62DH13 > 6IF732 > 6KW84W > 74UZGI > 7FDM86 > 8CFUQR > U4H3WM > 10AH2MF Yes, I understand this usecase (has been mentioned on https://bugs.kde.org/show_bug.cgi?id=179399 already). > (Notice that C sorting is still "wrong" here!) > > Hmm... okay, I guess this is almost impossible to solve without user > input. But it's really, REALLY freakin' annoying in file dialogs; the > list is all but useless in such cases. > > In the example above, C sorting would be okay since I usually know the > name of what I am looking for, so I can look for "1A..." and it is near > everything else starting with '1'. (But this is /exactly/ why natural > sorting is seriously fsck'd here; files starting with '1' end up all > over the place.) > > > I'm really against a per-directory option, as this hexadezimal-example is > > a corner case for a small group of users which does not justify a user > > visible UI option "[x] Natural Compare" inside a top-level-menu IMO. > > I'd be fine with a hidden option... from your argument, the people that > would need it are most likely to be comfortable dealing with such an > option. But in your case "hidden option" would mean that you want adjust your ".directory" file manually. Or do I missunderstand you? This would not work with the file dialog, as it ignores the .directory files... If I don't miss a thing, the problem in the file-dialog can only be solved by: - a global option (= my suggestion in the reviewboard) - a user visible option "[x] Natural Sorting" in the configuration menu I'd be interested into more details of your usecase: - How often do you need to select a file in Dolphin or the file-dialog that is named in hexadezimal way? - Is the number of named hexadecimal files really so large that you lose a lot of time in your daily workflow? Taking the file dialog as example: If you'd have a user visible configuration "[x] Natural Sorting" you'd need to disable this setting each time you enter such a directory and would need to enable it again each time before you leave it :-( - Wouldn't it be faster anyhow that you use the filter functionality (Strg+I) from Dolphin or the filename-combo in the file-dialog? Best regards, Peter