Ticket #1994 (closed enhancement: fixed)

Opened 9 years ago

Last modified 9 years ago

[PATCH] Sort files by version (like strverscmp(3) does)

Reported by: bvk Owned by: slavazanko
Priority: major Milestone: 4.7.1
Component: mc-core Version: master
Keywords: panel sort Cc:
Blocked By: Blocking:
Branch state: Votes for changeset: committed-master

Description

Suppose we have 3 files with version in their names:

file-2.1.tgz
file-2.2.tgz
file-2.10.tgz

It is impossible to see them in natural order using standard facilities, they will be sorted in alphabet order:

file-2.1.tgz
file-2.10.tgz
file-2.2.tgz

There was some attempts to fix this. I've picked up the patch by Roland Illig <roland illig gmx de> (http://mail.gnome.org/archives/mc-devel/2004-July/msg00016.html) and adopted it for today's git snapshot. It adds "version" option to the sort menu, which uses copy of strverscmp function from glibc.

Attachments

versionsort.patch (5.8 KB) - added by bvk 9 years ago.

Change History

Changed 9 years ago by bvk

comment:1 Changed 9 years ago by slavazanko

  • Owner set to slavazanko
  • Status changed from new to accepted

comment:2 Changed 9 years ago by slavazanko

  • Keywords panel added
  • Version changed from version not selected to master
  • severity changed from no branch to on review
  • Milestone changed from 4.7 to 4.7.1

Created branch 1994_sort_files_by_version

Initial changeset:099cf996942907213e52e5b5b48befd0db98e774

Review, please.

comment:3 Changed 9 years ago by slavazanko

  • Votes for changeset set to slavazanko

comment:4 Changed 9 years ago by andrew_b

I think we should use strverscmp(3) if possible. If there is no such function in target platform then use own implementation of strverscmp().

comment:5 Changed 9 years ago by andrew_b

  • severity changed from on review to on rework

The height of 'Sort order' dialog window should be increased to provide one empty row between sort mode radiobuttons and main dialog buttons (OK and Cancel) for more nice view.

comment:6 Changed 9 years ago by slavazanko

  • Votes for changeset slavazanko deleted
  • severity changed from on rework to on review

Review, please.

comment:7 Changed 9 years ago by iNode

  • Votes for changeset set to iNode

comment:8 Changed 9 years ago by angel_il

  • Votes for changeset changed from iNode to iNode angel_il
  • severity changed from on review to approved

comment:9 Changed 9 years ago by slavazanko

  • Status changed from accepted to testing
  • Votes for changeset changed from iNode angel_il to commited-master
  • Resolution set to fixed
  • severity changed from approved to merged

comment:10 Changed 9 years ago by slavazanko

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.