Bug 1111679 - xdg-open assumes only 1 application specified for a given mimetype by xdg-mime so falls back to browser to open files
Summary: xdg-open assumes only 1 application specified for a given mimetype by xdg-mim...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: xdg-utils
Version: 20
Hardware: All
OS: All
unspecified
medium
Target Milestone: ---
Assignee: Rex Dieter
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-20 17:35 UTC by hanishkvc
Modified: 2015-06-29 21:14 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-06-29 21:14:30 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
A patch to xdg-open which should fix this problem (462 bytes, patch)
2014-06-20 17:35 UTC, hanishkvc
no flags Details | Diff

Description hanishkvc 2014-06-20 17:35:36 UTC
Created attachment 910844 [details]
A patch to xdg-open which should fix this problem

Description of problem: xdg-open uses xdg-mime to decide what application to use for openning a file, if running in a unknown desktop or non desktop based gui environment. In turn because xdg-mime returns name of multiple applications (application.desktop files) if registered to operate on that given type of file in turn in a single line with space used to seperate them. xdg-open tries to use the returned line as it is as a application to open the file, and this fails for the case where there is more than one application registered to operate on a given file type. So in turn instead of using the configured application it uses a browser as the fallback mechanism to open the file.


Version-Release number of selected component (if applicable):
xdg-utils-1.1.0-0.24.rc2.fc20.noarch

How reproducible:
Always

Steps to Reproduce:
1. Have Openbox, evince, gimp installed
2. Run X using startx and a .xinitrc which specifies openbox
3. xdg-open /pathto/file.pdf

Actual results:

Opens the pdf file within firefox

Expected results:

Evince should have been used to open the pdf file.

Additional info:

I have attached a patch which fixes the problem in xdg-open

Comment 1 Rex Dieter 2015-01-05 13:48:52 UTC
I think the real problem is that 'xdg-mime query default ...' should never return > 1 entry.

I cannot reproduce that case where this can happen.

What does this return for you?

xdg-mime query default application/pdf

Comment 2 c.keil 2015-01-30 19:34:48 UTC
I am not the original submitter, but I have the same problem.

$ xdg-mime query default application/pdf
evince.desktop inkscape.desktop

The "problem" lies in the combination of the default application specification and the mimeinfo cache:

$ grep application/pdf /usr/share/applications/defaults.list /usr/share/applications/mimeinfo.cache
/usr/share/applications/defaults.list:application/pdf=evince.desktop
/usr/share/applications/mimeinfo.cache:application/pdf=inkscape.desktop;evince.desktop;evince-previewer.desktop;calibre-gui.desktop;calibre-ebook-viewer.desktop;gv.desktop;xpdf.desktop;gimp.desktop;

The code in xdg-mime queries both at the same time with one grep (line 953 in xdg-mime 1.1.0 rc3) returning above concatenation of evince and inkscape,

Comment 3 Fedora End Of Life 2015-05-29 12:10:33 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Rex Dieter 2015-05-29 12:13:17 UTC
Looks like this is (essentially) a dup of bug #1195718 , but only fixed in f21+

I'll consider an update for f20 too, but I'm a little nervous introducing any regressions this close to eol.

Comment 5 Fedora End Of Life 2015-06-29 21:14:30 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.