From 370b1428714599a5a8de38825f8332950f3f0bcc Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 14 Jul 2018 22:59:28 +0530 Subject: [PATCH] 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) --- src/calibre/gui2/tweak_book/file_list.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/tweak_book/file_list.py b/src/calibre/gui2/tweak_book/file_list.py index 78979fc2f2..2b55b991a2 100644 --- a/src/calibre/gui2/tweak_book/file_list.py +++ b/src/calibre/gui2/tweak_book/file_list.py @@ -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)