Repository navigation
Fix mimeapps.list corruption from QSettings escaping - #104
Merged
dim-ghub merged 2 commits intoOct 7, 2026
Merged
Conversation
Better-Than-You
added a commit
to Better-Than-You/Atlas
that referenced
this pull request
Oct 10, 2026
Replace our hand-rolled Default/Added-association writer with the more robust implementation merged upstream (AstraSuite/Atlas PR AstraSuite#104, commit 9f9837d): a plain-XDG MimeappsData model, parseMimeapps/writeMimeapps helpers, migration of group/key names previously mangled by QSettings::IniFormat, and Removed Associations handling. setDefaultApp now reports success (bool) and warns when a per-desktop * -mimeapps.list shadows the shared file. Our extra behaviour is preserved on top of it: - desktop entries are still parsed by hand so multi-valued MimeType fields are not collapsed by QSettings - NoDisplay handlers (e.g. swappy) still appear in Open With and can be resolved as defaults - setting a default still registers the whole MIME group the app declares - Terminal=true entries are still launched in a terminal emulator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #100.
setDefaultApp()wrote mimeapps.list viaQSettings(IniFormat), whichescapes to
[Added%20Associations]/application\\json— unreadable togio, xdg-mime, and GTK, so every default set in Atlas silently broke
everywhere except Atlas (QSettings unescapes its own writes, hiding it).
This replaces the read/write path with a small spec-compliant INI
parse/mutate/serialize (atomic via
QSaveFile), migrates legacy mangledentries on first write, treats Default values as
;-lists, stripsRemoved Associations, and drops the redundantxdg-mimespawn.Before:
[Added%20Associations]+application\\pdf=chromium.desktopAfter:
[Default Applications]+application/pdf=helium.desktopTested the usual flows (fresh file, changing defaults, old mangled file,
unreadable file) and confirmed with
gio mimethat the written fileresolves correctly.