From f28aed051186076b966fce4171cc4185d0f64878 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 2 Apr 2010 12:44:54 +0530 Subject: [PATCH] Fix .desktop files generated by linux installer --- src/calibre/linux.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/calibre/linux.py b/src/calibre/linux.py index 5d99a217a6..d0ac82e319 100644 --- a/src/calibre/linux.py +++ b/src/calibre/linux.py @@ -376,11 +376,14 @@ class PostInstall: check_call('xdg-icon-resource install --size 128 calibre-viewer.png calibre-viewer', shell=True) self.icon_resources.append(('apps', 'calibre-viewer', '128')) + mimetypes = set([]) + for x in all_input_formats(): + mt = guess_type('dummy.'+x)[0] + if mt and 'chemical' not in mt: + mimetypes.add(mt) + def write_mimetypes(f): - for x in all_input_formats(): - mt = guess_type('dummy.'+x)[0] - if mt: - f.write('MimeType=%s;\n'%mt) + f.write('MimeType=%s;\n'%';'.join(mimetypes)) f = open('calibre-lrfviewer.desktop', 'wb') f.write(VIEWER) @@ -531,7 +534,7 @@ Version=1.0 Type=Application Name=E-book Viewer GenericName=Viewer for E-books -Comment=Viewer for E-books +Comment=Viewer for E-books in all the major formats TryExec=ebook-viewer Exec=ebook-viewer %F Icon=calibre-viewer @@ -545,7 +548,7 @@ Version=1.0 Type=Application Name=calibre GenericName=E-book library management -Comment=E-book library management +Comment=E-book library management: Convert, view, share, catalogue all your e-books TryExec=calibre Exec=calibre Icon=calibre-gui