mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04: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
@ -184,6 +184,8 @@ else:
|
||||
|
||||
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…
x
Reference in New Issue
Block a user