Bug 95051

Summary: xdg-mime does not write the file it reads in a query
Product: Portland Reporter: André Glüpker <freedesktop>
Component: xdg-utilsAssignee: Portland Bugs <portland-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: shadowkyogre.public, tezeb+freedesktop
Version: unspecifiedKeywords: patch
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Fixes make_default_generic to write to the non deprecated generic path
Minimal test case, part 1
Minimal test case, part 2

Description André Glüpker 2016-04-21 13:42:10 UTC
A xdg-mime query will read .config/mimeapps.list first (https://cgit.freedesktop.org/xdg/xdg-utils/tree/scripts/xdg-mime.in?id=ef8a58be4049697bb6347c3c5b8fff4d2b2deb86#n397).

But setting a default application will write to .local/share/applications/mimeapps.list (https://cgit.freedesktop.org/xdg/xdg-utils/tree/scripts/xdg-mime.in#n244).

This way one can't change the default application, if .config/mimeapps.list was created by some means.

Also, xdg-mime will fail with returncode 4 in that case, which isn't very descriptive.
Comment 1 shadowkyogre.public 2016-05-04 22:47:00 UTC
Created attachment 123476 [details] [review]
Fixes make_default_generic to write to the non deprecated generic path
Comment 2 shadowkyogre.public 2016-05-04 22:48:03 UTC
Created attachment 123477 [details]
Minimal test case, part 1
Comment 3 shadowkyogre.public 2016-05-04 22:48:29 UTC
Created attachment 123478 [details]
Minimal test case, part 2
Comment 4 Rex Dieter 2016-05-05 11:59:03 UTC
Thanks, I'll review and commit soon.
Comment 6 Rex Dieter 2017-03-07 13:15:54 UTC
*** Bug 99106 has been marked as a duplicate of this bug. ***

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.