photools.com Community

IMatch Discussion Boards => General Discussion and Questions => Topic started by: ubacher on September 18, 2021, 09:03:22 PM

Title: Sorting by folder not the same order as on folder tree
Post by: ubacher on September 18, 2021, 09:03:22 PM
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?
Title: Re: Sorting by folder not the same order as on folder tree
Post by: ubacher on September 18, 2021, 09:19:36 PM
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.
Title: Re: Sorting by folder not the same order as on folder tree
Post by: Mario on September 18, 2021, 09:20:38 PM
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?
Title: Re: Sorting by folder not the same order as on folder tree
Post by: ubacher on September 18, 2021, 09:25:48 PM
In the Standard setting 2021 Odds sorts before 2021-01...

The FOLDER setting in the sort profile sorts the opposite.
Title: Re: Sorting by folder not the same order as on folder tree
Post by: Mario on September 19, 2021, 11:12:07 AM
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.
Title: Re: Sorting by folder not the same order as on folder tree
Post by: Mario on September 19, 2021, 11:42:48 AM
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.
Title: Re: Sorting by folder not the same order as on folder tree
Post by: ubacher on September 20, 2021, 06:05:43 AM
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.