GNOME Bugzilla – Bug 744893
evince-previewer should not register mime types
Last modified: 2016-06-09 18:20:01 UTC
Hello, evince-previwer is not allowing the user to select the printer where the document will be sent and is always using the default one. I already sent some private document to the wrong printer because of that
evince-previewer is not meant to be used directly users, but by scripts or applications as a print previewer. the caller should always provide the print settings, including the printer. Use evince to print, not evince-previewer.
The .desktop file of evince-previewer is associating the program to several mime-types. Shouldn't this be removed then? On my machine it's expanded to: MimeType=application/pdf;application/x-bzpdf;application/x-gzpdf;application/x-xzpdf;application/x-ext-pdf;application/postscript;application/x-bzpostscript;application/x-gzpostscript;image/x-eps;image/x-bzeps;image/x-gzeps;application/x-ext-ps;application/x-ext-eps;application/x-dvi;application/x-bzdvi;application/x-gzdvi;application/x-ext-dvi;image/vnd.djvu;application/x-ext-djv;application/x-ext-djvu;image/tiff;application/x-cbr;application/x-cbz;application/x-cb7;application/x-cbt;application/x-ext-cbr;application/x-ext-cbz;application/x-ext-cb7;application/x-ext-cbt;application/oxps;application/vnd.ms-xpsdocument;
(In reply to Laurent Bigonville from comment #2) > The .desktop file of evince-previewer is associating the program to several > mime-types. Shouldn't this be removed then? > > On my machine it's expanded to: > > MimeType=application/pdf;application/x-bzpdf;application/x-gzpdf;application/ > x-xzpdf;application/x-ext-pdf;application/postscript;application/x- > bzpostscript;application/x-gzpostscript;image/x-eps;image/x-bzeps;image/x- > gzeps;application/x-ext-ps;application/x-ext-eps;application/x-dvi; > application/x-bzdvi;application/x-gzdvi;application/x-ext-dvi;image/vnd.djvu; > application/x-ext-djv;application/x-ext-djvu;image/tiff;application/x-cbr; > application/x-cbz;application/x-cb7;application/x-cbt;application/x-ext-cbr; > application/x-ext-cbz;application/x-ext-cb7;application/x-ext-cbt; > application/oxps;application/vnd.ms-xpsdocument; The same ones as the evince desktop file, but the evince-previewer desktop file has NoDisplay=true so that it shouldn't appear in menus, for example.
The menu entry is definitely shown in nautilus "Open with" menu. And other applications (ie. claws-mail) are even using evince-previwer as the default applications to open the PDF.
It could be a bug in the distribution.
I'm seeing the same behaviour on both debian unstable and Fedora 22 alpha3
This is indeed a problem ... I'm not sure if it's possible to add a key to the desktop file to tell GTK+ not to use this in open with. Or maybe NoDisplay should be honored, I don't know.
Well the fact that evince-previwer is shown in the open with is due to the mimetype association... Removing the mimetype would remove it from the list
Like I said, dropping the Mimetype association make the application disappears from the list when opening a file. If -preview is really meant to not be used by a user directly it shouldn't be proposed in that list. Apparently this is not breaking the print preview
I tested removing the MimeType line from evince-previewer.desktop. It removes print preview from gnome's "open with other applications" menu and I didn't see any negative consequences. Also on Debian, removing the mimetype will keep evince-previewer from appearing in /etc/mailcap. Debian has scripts that add info from .desktop files to mailcap and removing the mimetype fixes problems like https://bugs.debian.org/825418 where mail programs open PDFs in evince-previewer instead of evince.
(In reply to Jason Crain from comment #10) > I tested removing the MimeType line from evince-previewer.desktop. It > removes print preview from gnome's "open with other applications" menu and I > didn't see any negative consequences. See Bug 694482 git blame can point you to the log and the reason behind why some code is the way it is.
(In reply to Germán Poo-Caamaño from comment #11) > (In reply to Jason Crain from comment #10) > > I tested removing the MimeType line from evince-previewer.desktop. It > > removes print preview from gnome's "open with other applications" menu and I > > didn't see any negative consequences. > > See Bug 694482 > > git blame can point you to the log and the reason behind why some code is > the way it is. Yes, I found that bug when I tried to find out why the evince-previewer.desktop file was added. I see that it was added to fix the window title and icon, but I don't see anything that makes me believe having evince-previewer register mime types was intentional. Removing the MimeType line while keeping the rest of the .desktop file as it is keeps the window name and icon working and stops evince-previewer from appearing in some menus.
I see. It makes sense to remove it then.
Created attachment 329432 [details] [review] Remove the MimeType association from the evince-previewer.desktop file evince-previewer is not supposed to be used directly by the users and then shouldn't be added to the list of available applications when opening files. On debian it causes issues as the .desktop file are automatically registered in the /etc/mailcap file and applications using this mechanism will prefer evince-previewer over evince itself, see: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=825418
Review of attachment 329432 [details] [review]: Ok