mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #2000582 [When converting to newer file format version, original file is shown without a format icon.](https://bugs.launchpad.net/calibre/+bug/2000582)
This commit is contained in:
parent
478f910611
commit
771d37b3c1
@ -815,9 +815,12 @@ class FileIconProvider(QFileIconProvider):
|
|||||||
|
|
||||||
def key_from_ext(self, ext):
|
def key_from_ext(self, ext):
|
||||||
key = ext if ext in self.icons else 'default'
|
key = ext if ext in self.icons else 'default'
|
||||||
if key == 'default' and ext.count('.') > 0:
|
if key == 'default' and '.' in ext:
|
||||||
ext = ext.rpartition('.')[2]
|
ext = ext.rpartition('.')[2]
|
||||||
key = ext if ext in self.icons else 'default'
|
key = ext if ext in self.icons else 'default'
|
||||||
|
if key == 'default' and ext.startswith('original_'):
|
||||||
|
ext = ext.partition('_')[2]
|
||||||
|
key = ext if ext in self.icons else 'default'
|
||||||
if key == 'default':
|
if key == 'default':
|
||||||
key = ext
|
key = ext
|
||||||
return key
|
return key
|
||||||
|
Loading…
x
Reference in New Issue
Block a user