Bug 456355 - Hitting "Points to" button resolves path wrong from desktop link
Summary: Hitting "Points to" button resolves path wrong from desktop link
Status: ASSIGNED
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-07-05 14:40 UTC by Yerrey Dev
Modified: 2022-07-06 16:51 UTC (History)
2 users (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 Yerrey Dev 2022-07-05 14:40:54 UTC
SUMMARY

Currently when "Points to" button in desktop link properties is clicked the resolvedTargetLocation for example QUrl("desktop:/home/yerrey/Pictures/avatar.png") is resolved into "/home/yerrey/Desktop/home/yerrey/Pictures/avatar.png" which cannot be found. 

The following change seems to fix the issue, but I'm not too familiar with KIO code to know if this is the correct solution or misses some edge cases I'm unaware of.

https://invent.kde.org/yerrey/kio/-/commit/ac516f38200557abab5a44f739c1bcc13e3ce061

With this the resolvedTargetLocation is correctly QUrl("file:///home/yerrey/Pictures/avatar.png") . 

STEPS TO REPRODUCE
1. Drag a file to your desktop, and choose "Link"
2. On your desktop, open the properties of the link
3. On the "Points to" line, hit the button to highlight the file in Dolphin

OBSERVED RESULT
The path cannot be found as it has prepended the correct path with Desktop path.

EXPECTED RESULT
Correct file is highlighted.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.25.80
KDE Frameworks Version: 5.96.0
Qt Version: 5.15.5
KIO: Master
Comment 1 Nate Graham 2022-07-05 18:29:18 UTC
Can confirm the issue and the fix looks sane. Feel free to submit it. In general, err on the side of submitting patches directly to invent.kde.org, rather than speculatively putting them in bug reports. They are likely to get missed here. See https://community.kde.org/Get_Involved/Issue_Reporting#Submit_patches_using_GitLab.2C_not_the_issue_tracker

Thanks!
Comment 2 Bug Janitor Service 2022-07-06 16:51:21 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/898