After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 744893 - evince-previewer should not register mime types
evince-previewer should not register mime types
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
3.14.x
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-02-21 15:15 UTC by Laurent Bigonville
Modified: 2016-06-09 18:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Remove the MimeType association from the evince-previewer.desktop file (1.19 KB, patch)
2016-06-09 07:48 UTC, Laurent Bigonville
accepted-commit_now Details | Review

Description Laurent Bigonville 2015-02-21 15:15:47 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
Comment 1 Carlos Garcia Campos 2015-03-08 08:45:43 UTC
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.
Comment 2 Laurent Bigonville 2015-03-09 09:44:35 UTC
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;
Comment 3 Carlos Garcia Campos 2015-03-10 17:19:39 UTC
(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.
Comment 4 Laurent Bigonville 2015-03-10 22:28:48 UTC
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.
Comment 5 Germán Poo-Caamaño 2015-03-10 22:44:08 UTC
It could be a bug in the distribution.
Comment 6 Laurent Bigonville 2015-03-10 23:24:24 UTC
I'm seeing the same behaviour on both debian unstable and Fedora 22 alpha3
Comment 7 Carlos Garcia Campos 2015-03-11 18:41:28 UTC
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.
Comment 8 Laurent Bigonville 2016-05-27 19:55:21 UTC
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
Comment 9 Laurent Bigonville 2016-06-05 19:58:33 UTC
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
Comment 10 Jason Crain 2016-06-08 18:58:06 UTC
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.
Comment 11 Germán Poo-Caamaño 2016-06-08 19:15:25 UTC
(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.
Comment 12 Jason Crain 2016-06-08 19:35:47 UTC
(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.
Comment 13 Germán Poo-Caamaño 2016-06-08 19:55:29 UTC
I see. It makes sense to remove it then.
Comment 14 Laurent Bigonville 2016-06-09 07:48:51 UTC
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
Comment 15 Carlos Garcia Campos 2016-06-09 15:33:04 UTC
Review of attachment 329432 [details] [review]:

Ok