Unnatural sorting for numbers with leading zeros

Cerbera
Posts: 19
Joined: Thu May 31, 2007 10:53 pm

Unnatural sorting for numbers with leading zeros

Post by Cerbera » Tue Jun 24, 2008 7:02 am

I recently upgraded to 3.0.1018.1 and noticed the sort order is arbitrary until a Refresh is done. Even then, it is unnatural for numbers with leading zeros:

Image Image

Note that refreshing their order in the list of files did not update their order in the treeview.

Similarly, I often get a strange sort order with textual file names:

Image Image

Here's a mixture of folders and files of several types:

Image Image

IIRC, this was also the case in the 3.0.1016.10, which is the version I upgraded from. It was not the case in the 2.5 series.

Code: Select all

+- System -----------------------------

Microsoft Windows XP Home Edition 

Service Pack 2 (Build 2600)



CPU Speed		   : 1410 MHz

Total Memory		: 511 MB

Free Memory		 : 134 MB



+- SmartFTP ---------------------------

Version			 : 3.0.1018.1

Time Stamp		  : 2008-06-19 21:44:01

Platform			: x86

Unlicensed

Days in use		 : 412



+- Application DLL --------------------

sfFTPLib.dll		: 1.5.13.31

sfFavorites.dll	 : 1.0.14.1

sfFavoritesShellExtension.dll : 1.0.1.13

sfTransferQueue.dll : 1.0.11.1

sfFTPShellExtension.dll : 1.0.9.1



+- Language ---------------------------

SmartFTP.exe		: 3.0.1018.1



+- Internet Explorer ------------------

Version			 : 8.0.6001.17184



+- Winsock ----------------------------

Winsock			 : 2.2
My understanding is that Windows has native natural sorting available through CompareString() and friends. Making the sorting in SmartFTP match that in Windows Explorer by using standard Windows functions seems ideal, to me.
Last edited by Cerbera on Tue Jun 24, 2008 7:20 am, edited 1 time in total.

mb
Posts: 12029
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: Unnatural sorting for numbers with leading zeros

Post by mb » Tue Jun 24, 2008 1:22 pm

Thank you for your report. I have fixed the natural sort. Please try it again with the latest version: https://www.smartftp.com/download

But I'm unable to reproduce the problem that the listing is not sorted at all the first time. Do you know what triggers it? And in what situations is it correct?

Regards,
Mat
Last edited by mb on Tue Jun 24, 2008 2:42 pm, edited 1 time in total.

Cerbera
Posts: 19
Joined: Thu May 31, 2007 10:53 pm

Re: Unnatural sorting for numbers with leading zeros

Post by Cerbera » Wed Jun 25, 2008 10:50 am

Just installed the newest version, 3.0.1018.3:
  • Natural sorting is now correct for numbers with leading zeros.
  • Initially unsorted bug remains.
  • Folders in TreeView are initially sorted even when they are not initially sorted in ListView.
  • Initially unsorted bug sometimes occurs for folders I have previously visited with the SmartFTP 3.0 series.
  • Initially unsorted bug sometimes occurs for folders I have previously set sorting options, even in the 3.0 series.
I'm pretty sure it was always correct in the 2.5 series. I noticed the initially unsorted problem when I upgraded to the 3.0 series. I think it was unsorted right from the first view of the first FTP site I opened. I assumed my sorting preferences hadn't been carried forwards with the upgrade.

I only use the Icons view. I only right-click the ListView area to use context menu to sort the items. So, for each unsorted folder I have come across, here's what I do:
  1. First visit to a folder using 3.0 series. Initially unsorted in the ListView but notice illCOM and test are sorted properly in the TreeView:
    Image
  2. Right-clicked and selected Arrange Icons By > Name:
    Image
  3. The sorting option is applied. Order is correct, with two .png files amongst the .jpg files:
    Image
  4. Right-click again and select Arrange Icons By > Type:
    Image
  5. The sorting option is applied. Order is correct, with two .png files after the .jpg files:
    Image
  6. Right-click once more and select Arrange Icons By. None of the sort items are ticked, which seems like a bug:
    Image
  7. Compare with the context menu in Windows XP's Windows Explorer. A group of radio menu items are used, with the current sort option given a bullet point:
    Image
I have caching enabled in the Connection area of SmartFTP's Settings:

Image

On other servers, in some folders I initially get arrangement by type but not by name. Other folders are initially unsorted. Sometimes the direction of Type sorting is initially opposite to what I would want. It happens more than not but the precise nature varies. I can't pin down any particular pattern, sorry. Folders never get mixed in with files.

As you can see from the screenshots, I use highly customised and simplified interface arrangement.

If you'd like to access the FTP servers I control, send me a PM and I'll reply with the login details. If you'd like any registry key values or configuration files, just let me know where to get them from. Thanks for looking into this. Looks like a sneaky one!
Last edited by Cerbera on Wed Jun 25, 2008 10:57 am, edited 1 time in total.

mb
Posts: 12029
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: Unnatural sorting for numbers with leading zeros

Post by mb » Wed Jun 25, 2008 10:29 pm

We believe we have identified the problem. Please try it again with the latest version:
https://www.smartftp.com/download

Regards,
mat

Cerbera
Posts: 19
Joined: Thu May 31, 2007 10:53 pm

Re: Unnatural sorting for numbers with leading zeros

Post by Cerbera » Thu Jun 26, 2008 4:13 am

Browsed a couple of folders and all seemed fine. Then visited a folder I haven't visited before using the 3.0 series:

  1. Initially unsorted:
    Image
  2. After a Refresh it is properly ordered:
    Image
  3. Looked at a different folder, then returned and it's unsorted again:
    Image
  4. Refresh sorts it but I can keep looping back to step 3, where it is unsorted once more.
Last edited by Cerbera on Thu Jun 26, 2008 4:16 am, edited 1 time in total.

mb
Posts: 12029
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: Unnatural sorting for numbers with leading zeros

Post by mb » Thu Jun 26, 2008 1:30 pm

I'm sorry but we cannot reproduce the problem. Actually we never could and we tested it on about 5 XP systems.

Is the sort by in the context menu at least correct now?

Regards,
Mat
Last edited by mb on Thu Jun 26, 2008 1:34 pm, edited 1 time in total.

mb
Posts: 12029
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: Unnatural sorting for numbers with leading zeros

Post by mb » Thu Jun 26, 2008 9:18 pm

I looked at your screenshots again. Are you sure the view is sorted by name and not by type?

Regards,
Mat

Cerbera
Posts: 19
Joined: Thu May 31, 2007 10:53 pm

Re: Unnatural sorting for numbers with leading zeros

Post by Cerbera » Fri Jun 27, 2008 9:11 am

Last edited by Cerbera on Fri Jun 27, 2008 9:12 am, edited 1 time in total.

mb
Posts: 12029
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: Unnatural sorting for numbers with leading zeros

Post by mb » Fri Jun 27, 2008 2:43 pm

We believe the bug is in the ShellView control from Microsoft. As you correctly noticed the control does not support autosort that's why the files are not automatically sorted when uploaded. Autosort is supported on Windows Vista.

Regards,
Mat

Cerbera
Posts: 19
Joined: Thu May 31, 2007 10:53 pm

Re: Unnatural sorting for numbers with leading zeros

Post by Cerbera » Fri Jun 27, 2008 4:27 pm

That sounds plausible. Perhaps Microsoft would be receptive of a bug report from yourselves and make a fixed version of the control available?

Having to do a Refresh each time I visit a folder is getting really old! The 2.5 series of SmartFTP didn't require it. Neither does Windows Explorer on Windows XP.
Last edited by Cerbera on Fri Jun 27, 2008 4:29 pm, edited 1 time in total.

Locked