Bug 99106 - xdg-mime defualt is inconsistent with xdg-open
Summary: xdg-mime defualt is inconsistent with xdg-open
Status: REOPENED
Alias: None
Product: Portland
Classification: Unclassified
Component: xdg-utils (show other bugs)
Version: 1.1.0 rc3
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: Portland Bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-16 11:25 UTC by tezeb
Modified: 2017-03-07 14:12 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tezeb 2016-12-16 11:25:49 UTC
Steps to reproduce:
1. DE set to gnome3
2. unset XDG_DATA_HOME
3. have multiple valid pdf applications installed(ie. gimp, evince)
4. assume no custom settings for handlers
5. run: xdg-mime query default application/pdf
With XDG_UTILS_DEBUG_LEVEL, it will display multiple paths being checked. It finds gimp.desktop in /usr/share/applications/defaults.list
6. run: xdg-mime default /usr/share/applications/evince.desktop application/pdf
Again, debug shows:
Updating /home/user/.local/share/applications/mimeapps.list
7. run: xdg-mime query default application/pdf
It displays '/usr/share/applications/evince.desktop' as expected.

8. run: xdg-open xxx.pdf
It opens gimp.desktop(or whatever was the default).

The BUG:
Internally xdg-open uses gvfs-open(version 1.30.3 here), which uses ~/.config/ as default XDG_DATA_HOME when the variable is unset, but xdg-mime uses some awk magic and completly different path.
Comment 1 layus 2017-03-06 11:11:21 UTC
It is even worse than that. reading and setting values does not occur in the same file:

$ XDG_UTILS_DEBUG_LEVEL=3 xdg-mime query default text/html
Checking /home/gmaudoux/.config/mimeapps.list
firefox.desktop

$ XDG_UTILS_DEBUG_LEVEL=3 xdg-mime default chromium-browser.desktop text/html
make_default_kde: No kde runtime detected
make_default_generic chromium-browser.desktop text/html
Updating /home/gmaudoux/.local/share/applications/mimeapps.list

$ XDG_UTILS_DEBUG_LEVEL=3 xdg-mime query default text/html
Checking /home/gmaudoux/.config/mimeapps.list
firefox.desktop
Comment 2 layus 2017-03-06 12:08:49 UTC
Oh, it seems this has been fixed in https://bugs.freedesktop.org/show_bug.cgi?id=95051. A new bugfix release for this ?
Comment 3 Rex Dieter 2017-03-07 13:15:54 UTC
ok, closing as dup

*** This bug has been marked as a duplicate of bug 95051 ***
Comment 4 tezeb 2017-03-07 14:05:29 UTC
Nice try... 
Still happens with patch from 95051 applied.
Have anyone even tested this?!!!!

The issue have to do with xdg-open, not only xdg-mime, which is clearly stated in reproduction step #7.
Comment 5 Rex Dieter 2017-03-07 14:12:52 UTC
sorry, misinterpreted comment #2 which claims that it is fixed


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.