g_app_info_get_all_for_type() does not show desktop entries overridden in ~/.local/share/applications
If a desktop entry is present both in a system location and in
~/.local/share/applications, it fails to show up in the result from
$ gio mime text/plain Default application for “text/plain”: geany.desktop Registered applications: [...] org.gnome.gedit.desktop Recommended applications: [...] org.gnome.gedit.desktop $ cp /usr/share/applications/org.gnome.gedit.desktop ~/.local/share/applications/ $ gio mime text/plain Default application for “text/plain”: geany.desktop Registered applications: [... org.gnome.gedit.desktop not listed] Recommended applications: [... org.gnome.gedit.desktop not listed]
The logic in
desktop_file_dir_unindexed_mime_lookup() eludes me, because it looks like it'd return desktop IDs form a directory only if that directory contained MIME associations for that app, which doesn't sound right, at least not for ~/.local/share/applications/.
This is problematic in any situations where the user would like to have an override for an existing application, be it to add an option, rename it or whatnot, or simply because he installed a local copy with a .desktop in ~/.local/share/applications/ so he can run it easily.
The issue exists for a long time (since 2.42 at the very least), and still in master.