From e42e31cdcbe530ec3a0adf6ded32be7eb515f3e5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 5 Jun 2018 14:28:04 +0530 Subject: [PATCH] Edit book: Fix searching in selected files not searching SVG files --- src/calibre/gui2/tweak_book/file_list.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/tweak_book/file_list.py b/src/calibre/gui2/tweak_book/file_list.py index e8051335de..9331de70a9 100644 --- a/src/calibre/gui2/tweak_book/file_list.py +++ b/src/calibre/gui2/tweak_book/file_list.py @@ -745,8 +745,11 @@ class FileList(QTreeWidget): ok = category in {'text', 'styles'} if ok: ans[category][name] = syntax_from_mime(name, mime) - if not ok and category == 'misc': - ok = mime in {guess_type('a.'+x) for x in ('opf', 'ncx', 'txt', 'xml')} + if not ok: + if category == 'misc': + ok = mime in {guess_type('a.'+x) for x in ('opf', 'ncx', 'txt', 'xml')} + elif category == 'images': + ok = mime == guess_type('a.svg') if ok: cats = [] if item.isSelected():