Edit book: When sorting non text files in the File list recognize numbers in the file names. Fixes #1781721 [[enhancement] editor, make order of images more natural in main screen](https://bugs.launchpad.net/calibre/+bug/1781721)

This commit is contained in:
Kovid Goyal 2018-07-14 22:59:28 +05:30
parent 790c6c67e3
commit 370b142871
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -41,7 +41,7 @@ from calibre.gui2.tweak_book import (
)
from calibre.gui2.tweak_book.editor import syntax_from_mime
from calibre.gui2.tweak_book.templates import template_for
from calibre.utils.icu import sort_key
from calibre.utils.icu import numeric_sort_key
TOP_ICON_SIZE = 24
NAME_ROLE = Qt.UserRole
@ -385,7 +385,7 @@ class FileList(QTreeWidget):
seen[text] = item
item.setText(0, text)
item.setText(1, hexlify(sort_key(text)))
item.setText(1, hexlify(numeric_sort_key(text)))
def render_emblems(item, emblems):
emblems = tuple(emblems)