mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 09:43:46 +02:00
Open With: Use a blank icon instead of erroring out on linux in case of malformed desktop files or icon themes
This commit is contained in:
parent
3e5f0e4bc7
commit
592fbc1490
2 changed files with 4 additions and 0 deletions
|
|
@ -184,6 +184,8 @@ def choose_manually(filetype, parent):
|
|||
|
||||
def entry_to_item(entry, parent):
|
||||
icon_path = entry.get('Icon') or I('blank.png')
|
||||
if not isinstance(icon_path, basestring):
|
||||
icon_path = I('blank.png')
|
||||
ans = QListWidgetItem(QIcon(icon_path), entry.get('Name') or _('Unknown'), parent)
|
||||
ans.setData(ENTRY_ROLE, entry)
|
||||
comment = (entry.get('Comment') or '')
|
||||
|
|
|
|||
|
|
@ -191,6 +191,8 @@ def find_programs(extensions):
|
|||
data['Icon'] = icon
|
||||
else:
|
||||
data.pop('Icon')
|
||||
if not isinstance(data.get('Icon'), basestring):
|
||||
data.pop('Icon', None)
|
||||
for k in ('Name', 'GenericName', 'Comment'):
|
||||
val = data.get(k)
|
||||
if val:
|
||||
|
|
|
|||
Loading…
Reference in a new issue