Sorting by folder not the same order as on folder tree

Started by ubacher, September 18, 2021, 09:03:22 PM

Previous topic - Next topic

ubacher

I have a sort profile starting with FOLDER followed by FILE NAME.
I expected the files to be sorted by folder in the same order that the folders are shown on the M&F tree.

They are not. Should they be?

ubacher

I found the following:
The M&F folder sorting is specified as Standard - the way FOLDER sorts is ALPHABETICALLY

in other words: If I set the M&F sorting to alphabetically then I get the folders sorted in the same order as on the tree.

Mario

Yes. What other sort mode do you use for the Media & Folders View and the sort profile and what difference do you get? Are numbers or non-alphanumerical characters involved?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

In the Standard setting 2021 Odds sorts before 2021-01...

The FOLDER setting in the sort profile sorts the opposite.

Mario

The sort profile for folders does not know if you use one of the special modes in the Media & Folder tree view to change how folders are displayed in that tree control.
The Media & Folders tree control supports 5 different sort modes for folders.

It's many years (!) since I've looked at the sorting code. It sorts by folder name using a lexicographical compare (standard string sorting) which may produce slightly different orders that the specialized file system object sorting available in the Media & Folders View and also applied by the File Window in the show hierarchy mode, in cases where numbers or special non-ANSI characters are involved.

I'm reluctant to make any changes here, because a) this sort routine is unchanged since IMatch 5 and b) changing it to meet your specific use case (what is your use case?) may break things for other users. Not sure. Maybe add another specialized sort profile Attribute for sorting folders in the same way as used by the Media & Folders tree...We have the same for file names (several modes for sorting by name).
Please add a feature request so we can see how many users would like to have this.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Mario

Forget it. It was easy enough to add a new sort profile attribute Folder (Smart) similar to File Name (Smart).
This new attribute uses the same special lexicographical compare the Media & Folders tree offers.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

The only problem was that the FOLDER sorting (only one available) was not the same as the Standard sorting
used in the Folder tree. Once I found that I could change the sorting in the M&F folder tree all was well.