Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Name column can sort incorrectly after feed to listbox

 
Post new topic   Reply to topic    Total Commander Forum Index -> TC Behaviour which will not be changed Printable version
View previous topic :: View next topic  
Author Message
jdmarch
Member
Member


Joined: 11 Mar 2003
Posts: 158
Location: St. Louis, Missouri, USA

PostPosted: Fri Jan 08, 2010 8:37 am    Post subject: Name column can sort incorrectly after feed to listbox Reply with quote

Task: after feeding search results to a listbox, sort by filename.
Problem: the built-in "Name" column includes path in this context.

First attempt: include a custom column [=tc.path]. Now the"Name" column automagically displays only filenames, not paths. Great!
Problem: But the "Name" column still sorts by the path which it is not displaying, rather than by the filename that it is displaying.
Bug?: This seems like a bug to me; you expect a column to sort on its visible contents.

Next attempt: Use custom columns [=tc.name] and/or [=tc.ext]., and try to disappear the built-in Name and Ext column.
Problems: The built-in columns Name and Ext cannot be moved or made to disappear. Also the useful filetype/folder icons are in Name but not in [=tc.name].

Final attempt: Apparently the best I can do is to make Name column 10 units wide and make Ext column 20 units wide, which causes some pixel pollution between these columns, but not too bad. After these comes [=tc.name], which is a counter-intuitive display order (extension before name).

Proposal: Make the Name column sort on its displayed contents.

This has been reported before in much less detail, but I did not see any discussion of it. See the last post of: http://ghisler.ch/board/viewtopic.php?t=7268
Back to top
View user's profile Send private message
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 24702
Location: Switzerland

PostPosted: Mon Jan 11, 2010 11:27 am    Post subject: Reply with quote

This is indeed intentional to get consistent sort orders for full view and custom columns view. I have considered to sort by displayed names also for other fields or field parts, but it would lead to a big number of problems (e.g. when sorting by parts of numeric fields)...
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jdmarch
Member
Member


Joined: 11 Mar 2003
Posts: 158
Location: St. Louis, Missouri, USA

PostPosted: Mon Jan 11, 2010 11:38 am    Post subject: Reply with quote

Thanks. I think I understand you, but of course by holding to one kind of consistency you've introduced an inconsistency with standard user expectations, which is that a plain filename column will sort on plain filename. Maybe an option...?
Back to top
View user's profile Send private message
karlchen
Power Member
Power Member


Joined: 06 Feb 2003
Posts: 4040
Location: Germany

PostPosted: Tue Jan 12, 2010 10:25 am    Post subject: Re: Name column can sort incorrectly after feed to listbox Reply with quote

Hello, jdmarch.

Quote:
Final attempt: Apparently the best I can do is to make Name column 10 units wide and make Ext column 20 units wide, which causes some pixel pollution between these columns, but not too bad. After these comes [=tc.name], which is a counter-intuitive display order (extension before name).

All right, here is the workaround which looks and works in a satisfying way here (just a modification of your idea Wink ):
Code:
[CustomFields]
AutoLoad=0
Titles=Search Results
Widths1=10,5,200,350,-60,-60,-20
Headers1=Name\nFolder\nSize\nDate\nAttr
Contents1=[=tc.fullname]\n[=tc.path]\n[=tc.size]\n[=tc.writedate]\n[=tc.attributestr]
Options1=-1|1

You may have to adjust the chosen column widths a bit to match your display.
The unremovable EXT column is reduced to 5. You can still click on it to sort by extension. But the extension will not be visible any longer here.
The next column NAME [=tc.fullname] holds name plus extension. Thus you see name and extension in the right order.
You can sort by this column NAME (=tc.fullname).

Kind regards,
Karl
Back to top
View user's profile Send private message Send e-mail
jdmarch
Member
Member


Joined: 11 Mar 2003
Posts: 158
Location: St. Louis, Missouri, USA

PostPosted: Sun Jan 17, 2010 9:36 pm    Post subject: Reply with quote

Karl, thank you for the thought and the work. Unfortunately this does not make an improvement from my perspective. Unless the unremoveable EXT column is widented to 20, it pollutes the following name column. And once I've widened it, there's no reason (at least from my perspective) to use tc.fullname instead of tc.name -- it just wastes screen space.

For the record, this seems to be my best workaround:
Code:
Widths3=10,20,90,63,-30,400,80
Headers3=name\nDate\nSize\nPath\nAttr
Contents3=[=tc.name]\n[=tc.writedate]\n[=tc.size.bkMG2]\n[=tc.path]\n[=tc.attributestr]
Back to top
View user's profile Send private message
karlchen
Power Member
Power Member


Joined: 06 Feb 2003
Posts: 4040
Location: Germany

PostPosted: Mon Jan 18, 2010 3:16 am    Post subject: Reply with quote

Hello, jdmarch.

As soon as I have got the chance and time, I will post a screenshot illustrasting what the customfields view "Search Results" looks like here. A screenshot may ease undertanding a lot.

The unremovable EXT column does not pollute anything here. All it will hold here is two little dots.

The tc.fullname is used to make sure that filename and extension are displayed in the right order, filename first, extension second, without having to insert another column for the extension.

Maybe the crucial factor which decides whether you get what you want or whether you don't when using the view "Search Results" is this setting:
Configuration => Options => Display => Tabstops:
Show file extensions
(*) directly after filename
(_) aligned (with tab)

Extensions are displayed directly after the filename here.

Kind regards,
Karl
Back to top
View user's profile Send private message Send e-mail
Lefteous
Power Member
Power Member


Joined: 08 Feb 2003
Posts: 7675
Location: Germany

PostPosted: Mon Jan 18, 2010 3:34 am    Post subject: Reply with quote

The generic problem here is that only full paths can be unique. When using such a custom column view a secondary sort order is required. TC already has such a mechanism. There should be a way to show the search result not only in a preferable (column) view but also in a useful sort order - of course without manual activity.


2karlchen
Quote:
works in a satisfying way here

I don't think a workaround can be satisfying. It's really just a workaround.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
karlchen
Power Member
Power Member


Joined: 06 Feb 2003
Posts: 4040
Location: Germany

PostPosted: Mon Jan 18, 2010 6:04 pm    Post subject: Reply with quote

Lefteous wrote:
I don't think a workaround can be satisfying. It's really just a workaround.
Your point of view.

My point of view:
A workaround that does what I want is 100% better than no solution at all. Wink

Karl
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> TC Behaviour which will not be changed All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Impressum: This site is maintained by Ghisler Software GmbH

Using phpBB © 2001-2005 phpBB Group