From 8544b1c53b56456e1a86e867e87773225d6d8e7b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 15 Jun 2016 22:06:47 +0530 Subject: [PATCH] Add the ToC emblem for the EPUB 3 nav file --- src/calibre/gui2/tweak_book/file_list.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/tweak_book/file_list.py b/src/calibre/gui2/tweak_book/file_list.py index ac7570228a..2d978079a1 100644 --- a/src/calibre/gui2/tweak_book/file_list.py +++ b/src/calibre/gui2/tweak_book/file_list.py @@ -355,6 +355,7 @@ class FileList(QTreeWidget): cannot_be_renamed = container.names_that_must_not_be_changed ncx_mime = guess_type('a.ncx') + nav_items = frozenset(container.manifest_items_with_property('nav')) def create_item(name, linear=None): imt = container.mime_map.get(name, guess_type(name)) @@ -381,7 +382,7 @@ class FileList(QTreeWidget): if name in container.opf_name: emblems.append('metadata.png') tooltips.append(_('This file contains all the metadata and book structure information')) - if imt == ncx_mime: + if imt == ncx_mime or name in nav_items: emblems.append('toc.png') tooltips.append(_('This file contains the metadata table of contents')) if name not in manifested_names and not container.ok_to_be_unmanifested(name):