DesktopProtocol: If symlink target desktop file is unwritable, create new one to ApplicationsLocation

If user creates a symlink from applications launcher to desktop, and that symlink points to a flatpak related desktop file, it is unwritable. Therefore renaming it wont work, since rename process wants to rename the "friendly name" of the desktop file.

In these cases, we copy the symlink target desktop file data, create new one to the QStandardPaths::ApplicationsLocation, delete the old symlink and replace it with new one which points to the one we just created. Since this is writable, it will rename correctly.

BUG: 506032

Edited by Akseli Lahtinen

Merge request reports

Loading