mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Use load_icon_for_cmdline for manually added exe files
This commit is contained in:
parent
87343c715e
commit
3fa1331448
@ -124,7 +124,7 @@ if iswindows:
|
|||||||
return
|
return
|
||||||
qans = ans.replace('"', r'\"')
|
qans = ans.replace('"', r'\"')
|
||||||
name = friendly_app_name(exe=ans) or os.path.splitext(os.path.basename(ans))[0]
|
name = friendly_app_name(exe=ans) or os.path.splitext(os.path.basename(ans))[0]
|
||||||
return {'cmdline':'"%s" "%%1"' % qans, 'name':name, 'icon_resource':ans + ',0'}
|
return {'cmdline':'"%s" "%%1"' % qans, 'name':name}
|
||||||
|
|
||||||
def entry_to_cmdline(entry, path):
|
def entry_to_cmdline(entry, path):
|
||||||
cmdline = entry['cmdline']
|
cmdline = entry['cmdline']
|
||||||
|
@ -89,8 +89,8 @@ def load_icon_for_file(path: str, as_data=False, size=ICON_SIZE):
|
|||||||
return pixmap_to_data(pmap) if as_data else pmap
|
return pixmap_to_data(pmap) if as_data else pmap
|
||||||
|
|
||||||
|
|
||||||
def load_icon_for_cmdline(cmdline: str):
|
def load_icon_for_cmdline(cmdline: str, as_data=False, size=ICON_SIZE):
|
||||||
return load_icon_for_cmdline(split_commandline(cmdline)[0])
|
return load_icon_for_file(split_commandline(cmdline)[0], as_data=as_data, size=size)
|
||||||
|
|
||||||
|
|
||||||
def display_image(png_data):
|
def display_image(png_data):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user