Bug 450898 - After editing a symlinked .desktop file, KFileItem::linkDest returns an empty string
Summary: After editing a symlinked .desktop file, KFileItem::linkDest returns an empty...
Status: REPORTED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: Properties dialog (other bugs)
Version First Reported In: git master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-27 01:00 UTC by Roman Nikonov
Modified: 2022-02-27 01:00 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Nikonov 2022-02-27 01:00:11 UTC
SUMMARY
After editing a symlinked .desktop file, `KFileItem::linkDest()` returns an empty string, but `isLink()` still returns `true`.

See also: https://bugs.kde.org/show_bug.cgi?id=450727

STEPS TO REPRODUCE
0. Add a log line to https://invent.kde.org/frameworks/kio/-/blob/972a91a7588730303371cdcff32b15c916d0606d/src/widgets/kpropertiesdialog.cpp#L1545:
        qDebug() << "Symlink target check: isLink=" << item.isLink() << ", linkDest=" << item.linkDest() << ", newtarget=" << newTarget;
1. Install a package that contains a symlink from /usr/share/applications. For example, Discord package on Arch/Manjaro: `pacman -S discord`
2. Open Application Launcher
3. Right-click on an app installed on step 1, select 'Edit application'
4. Change something and click 'OK'


OBSERVED RESULT
Log output looks like this:
Symlink target check: isLink= true , linkDest= "" , newtarget= "/opt/discord/discord.desktop"


EXPECTED RESULT
Probably isLink should be false and linkDest still an empty string.


SOFTWARE/OS VERSIONS
Linux distro: Manjaro stable
KDE Plasma Version: master
KDE Frameworks Version: master with kio patch: https://invent.kde.org/frameworks/kio/-/merge_requests/768
Qt Version: 5.15.2