Bug 99106

Summary: xdg-mime defualt is inconsistent with xdg-open
Product: Portland Reporter: tezeb <tezeb+freedesktop>
Component: xdg-utilsAssignee: Portland Bugs <portland-bugs>
Status: RESOLVED MOVED QA Contact:
Severity: major    
Priority: medium    
Version: 1.1.0 rc3   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

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
Comment 6 GitLab Migration User 2019-02-16 13:38:25 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xdg/xdg-utils/issues/103.

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.