Jump to content


Photo

Unnatural sorting for numbers with leading zeros


This topic has been archived. This means that you cannot reply to this topic.
11 replies to this topic

#1 Cerbera

Cerbera
  • Members
  • 19 posts

Posted 24 June 2008 - 07: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:

Posted Image Posted 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:

Posted Image Posted Image

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

Posted Image Posted 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.

Edited by Cerbera, 24 June 2008 - 07:20 AM.


#2 mb

mb

    Developer

  • Administrators
  • 11521 posts

Posted 24 June 2008 - 01:22 PM

Thank you for your report. I have fixed the natural sort. Please try it again with the latest version: http://www.smartftp....get/SFTPMSI.exe

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

#3 Cerbera

Cerbera
  • Members
  • 19 posts

Posted 25 June 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:
  • 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:
    Posted Image
  • Right-clicked and selected Arrange Icons By > Name:
    Posted Image
  • The sorting option is applied. Order is correct, with two .png files amongst the .jpg files:
    Posted Image
  • Right-click again and select Arrange Icons By > Type:
    Posted Image
  • The sorting option is applied. Order is correct, with two .png files after the .jpg files:
    Posted Image
  • Right-click once more and select Arrange Icons By. None of the sort items are ticked, which seems like a bug:
    Posted Image
  • 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:
    Posted Image
I have caching enabled in the Connection area of SmartFTP's Settings:

Posted 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!

Edited by Cerbera, 25 June 2008 - 10:57 AM.


#4 mb

mb

    Developer

  • Administrators
  • 11521 posts

Posted 25 June 2008 - 10:29 PM

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

Regards,
mat

#5 Cerbera

Cerbera
  • Members
  • 19 posts

Posted 26 June 2008 - 04: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:

  • Initially unsorted:
    Posted Image
  • After a Refresh it is properly ordered:
    Posted Image
  • Looked at a different folder, then returned and it's unsorted again:
    Posted Image
  • Refresh sorts it but I can keep looping back to step 3, where it is unsorted once more.

Edited by Cerbera, 26 June 2008 - 04:16 AM.


#6 mb

mb

    Developer

  • Administrators
  • 11521 posts

Posted 26 June 2008 - 01: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

#7 mb

mb

    Developer

  • Administrators
  • 11521 posts

Posted 26 June 2008 - 09:18 PM

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

Regards,
Mat

#8 Cerbera

Cerbera
  • Members
  • 19 posts

Posted 27 June 2008 - 09:11 AM

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

Yes, that is working now (3.0.1018.4):
Posted Image

I want to sort by type, sorting by name within each type. That's what I've got in the above screenshot.
  • Upon returning to an FTP folder I've sorted, it remains sorted by type but not by name within each type:
    Posted Image
  • When I Refresh the folder, I get the exact sorting I want:
    Posted Image
So, to my non-expert eye, the issue is with a semi-complete sort being the default, while Refresh does a complete sort?

This name-within-type sorting is what I use throughout Windows XP with Windows Explorer:

Posted Image

I get this simply by selecting Arrange Icons By > Type from the Windows Explorer context menu. I don't need to select Name before doing this. It seems Name is the "tie-breaker" Windows Explorer uses with several files of the same type. I'd like SmartFTP to be consistent with that.

Thanks for your continued efforts to solve issues raised on this forum!


I just noticed another issue with sorting. Files are added to the ListView as they are being uploaded, which is good. However, the list is not re-sorted after each file is added. After all uploads are complete, they remain at the end:

Posted Image

Re-sorting the list each time a file gets added is what I would prefer. Perhaps this is related to the other issue?

Edited by Cerbera, 27 June 2008 - 09:12 AM.


#9 mb

mb

    Developer

  • Administrators
  • 11521 posts

Posted 27 June 2008 - 02: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

#10 Cerbera

Cerbera
  • Members
  • 19 posts

Posted 27 June 2008 - 04: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.

Edited by Cerbera, 27 June 2008 - 04:29 PM.


#11 mb

mb

    Developer

  • Administrators
  • 11521 posts

Posted 27 June 2008 - 04:29 PM

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

#12 Cerbera

Cerbera
  • Members
  • 19 posts

Posted 28 June 2008 - 02:32 PM

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!

Edited by Cerbera, 28 June 2008 - 02:46 PM.