Skip to content

KPropertiesDialog: fix saving changes when editing a .desktop file symlink

Ahmad Samir requested to merge work/ahmad/desktopfile-symlink into master

Conside the use case of: /usr/share/applications/foo.desktop is symlink to /opt/someapp/foo.desktop

relativeAppsLocation() was using QFile::canonicalFilePath(), which meant that foo.desktop would resolve to a file outside /usr/share/applications, since the code, rightly, expects files in QStandardPaths::ApplicationsLocation locations, m_sRelativePath would end up being empty, which makes the check in KFilePropsPlugin::slotCopyFinished() fail, and the .desktop file wouldn't get copied to ~/.local/share/applications/, and the saving would fail.

BUG: 450727 FIXED-IN: 5.95

Merge request reports