XdgMimeAppsGLibBackend::setDefaultApp uses the GLib function g_app_info_set_as_default_for_type(). The problem is that, apparently, GLib first reads ~/.config/lxqt-mimeapps.list to get the default apps (see GLib → gdesktopappinfo.c → desktop_file_dir_unindexed_read_mimeapps_lists()) but only writes to ~/.config/mimeapps.list to set the default apps (in g_app_info_set_as_default_for_type()).
Now, since the GLib backend doesn't touch ~/.config/lxqt-mimeapps.list, if it exists and contains some default apps, it couldn't really change those apps.
Moreover, IMO, we shouldn't touch ~/.config/mimeapps.listwhen setting default apps because it'll affect other DEs too.
@luis-pereira
Am I missing something obvious here? I think there is a contradiction in GLib and libqtxdg inherits it.
My work on https://github.com/lxqt/lxqt/issues/1513 was almost finished, when I found the following issue:
XdgMimeAppsGLibBackend::setDefaultApp
uses the GLib functiong_app_info_set_as_default_for_type()
. The problem is that, apparently, GLib first reads~/.config/lxqt-mimeapps.list
to get the default apps (see GLib →gdesktopappinfo.c
→desktop_file_dir_unindexed_read_mimeapps_lists()
) but only writes to~/.config/mimeapps.list
to set the default apps (ing_app_info_set_as_default_for_type()
).Now, since the GLib backend doesn't touch
~/.config/lxqt-mimeapps.list
, if it exists and contains some default apps, it couldn't really change those apps.Moreover, IMO, we shouldn't touch
~/.config/mimeapps.list
when setting default apps because it'll affect other DEs too.@luis-pereira Am I missing something obvious here? I think there is a contradiction in GLib and
libqtxdg
inherits it.