Unnatural sorting for numbers with leading zeros

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.

+- 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.

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

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!

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.

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

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

Regards,
Mat

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

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.

I don't think there will be a fix since the problem does not exist on Windows Vista. Also I do not really consider this a bug since the listing is sorted by Type but just not by Type, Name as you would like. Version 2.5 did not use the ShellView control from Microsoft and Windows Explorer has more control over the ShellView control which we don't have.

Regards,
Mat

After I do a Refresh the control is sorted by "Type, Name". So there is a bug because the initial sort is incomplete compared with the sort that happens after a Refresh. Making the initial sort match the sort which happens after Refresh is what you have to do.

If Windows Explorer does this by having "more control" which you "don't have", then that's all you need to add? You do such a good job to implement all the visual conventions of the OS and various Microsoft products. I would expect following the actually useful things, like good sorting, would be just as high a priority.

Viewing a list of files in a folder is quite a large part of what an FTP client is supposed to do!