Bug 95051 - xdg-mime does not write the file it reads in a query
Summary: xdg-mime does not write the file it reads in a query
Status: RESOLVED FIXED
Alias: None
Product: Portland
Classification: Unclassified
Component: xdg-utils (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Portland Bugs
QA Contact:
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-04-21 13:42 UTC by André Glüpker
Modified: 2017-03-07 13:15 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Fixes make_default_generic to write to the non deprecated generic path (840 bytes, patch)
2016-05-04 22:47 UTC, shadowkyogre.public
Details | Splinter Review
Minimal test case, part 1 (49 bytes, text/plain)
2016-05-04 22:48 UTC, shadowkyogre.public
Details
Minimal test case, part 2 (46 bytes, text/plain)
2016-05-04 22:48 UTC, shadowkyogre.public
Details

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.