lxqt / libqtxdg

Qt implementation of freedesktop.org xdg specs
https://lxqt.github.io
GNU Lesser General Public License v2.1
72 stars 35 forks source link

Can't handle symlink desktop entries #287

Closed tsujan closed 1 year ago

tsujan commented 1 year ago

Just use this to see it for yourself:

qtxdg-mat defapp text/csv -s libreoffice-calc.desktop

/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.

Steps to Reproduce (for bugs)
Context

See https://github.com/lxqt/lxqt-config/issues/897

System Information

Latest git LXQt