/usr/share/applications/libreoffice-calc.desktop is a symlink to /usr/lib/libreoffice/share/xdg/calc.desktop.
Possible Solution
The problem is that XdgDesktopFile::id() returns false in XdgMimeApps::setDefaultApp(), because XdgDesktopFile::load() returns a canonical path (by using QFileInfo::canonicalFilePath().
Even if we make XdgDesktopFile::id() return true, the association won't work because it will give calc.desktop (from inside /usr/lib/libreoffice/share/xdg/).
Since a canonical path is used everywhere, changing the behavior of XdgDesktopFile::load() might have serious side effects. A thorough examination is needed.
Just use this to see it for yourself:
/usr/share/applications/libreoffice-calc.desktop
is a symlink to/usr/lib/libreoffice/share/xdg/calc.desktop
.Possible Solution
The problem is that
XdgDesktopFile::id()
returnsfalse
inXdgMimeApps::setDefaultApp()
, becauseXdgDesktopFile::load()
returns a canonical path (by usingQFileInfo::canonicalFilePath()
.Even if we make
XdgDesktopFile::id()
returntrue
, the association won't work because it will givecalc.desktop
(from inside/usr/lib/libreoffice/share/xdg/
).Since a canonical path is used everywhere, changing the behavior of
XdgDesktopFile::load()
might have serious side effects. A thorough examination is needed.Steps to Reproduce (for bugs)
Context
See https://github.com/lxqt/lxqt-config/issues/897
System Information
Latest git LXQt