Bug 512218 - Creating a link to a subdirectory of a desktop link results in an invalid path
Summary: Creating a link to a subdirectory of a desktop link results in an invalid path
Status: RESOLVED DUPLICATE of bug 479350
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: Open/save dialogs (other bugs)
Version First Reported In: 6.20.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-16 19:54 UTC by Lluc
Modified: 2025-11-17 20:36 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 Lluc 2025-11-16 19:54:06 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Please remove this comment after reading and before submitting - thanks!
***

SUMMARY
When a user creates a link to a subdirectory of an existing desktop link via the usual workflow, the resulting link has an invalid path that starts with `desktop:/` instead of a proper file system path. This makes the link unusable.

STEPS TO REPRODUCE
1. Create a link to a directory on your desktop, for instance, a link to `/home/user/Documents`.
2. Right-click on the empty space on the desktop.
3. In the context menu, go to "Create New" -> "Link to a File or Directory...".
4. In the "Link to a File or Directory" dialog, select "Directory". This will open the `KUrlRequester` with the start location being the desktop, but in the bottom bar you will see `desktop:/`. 
5. Select a subdirectory of the directory you linked to in step 1. The bottom bar will show something like `desktop:/Documents/some_subdir/`. Then click "Ok" and also click "Ok" in the other dialog.

OBSERVED RESULT
A new link is created on the desktop, but its path is invalid. The path starts with `desktop:/`, for example, `desktop:/Documents/some_subdirectory`. This link is not functional.

EXPECTED RESULT
A new link is created on the desktop that points to the selected subdirectory. The link's path should be a valid file system path, for example, `/home/user/Documents/some_subdirectory`

ADDITIONAL INFORMATION
This bug can be avoided if one just selects "Desktop" from the menu on the left of the `KUrlRequester` and then selects the subdirectory of the link from there. However the fact that by default the `KUrlRequester` starts in the `desktop:/` location is the problem. My mum was the one who uncovered this bug to me (I don't usually create symlinks for almost anything) and she just did what she thought was correct, which then generated a non-working link. 
I tried fixing this and kinda achieved it with a simple change which I presented in https://invent.kde.org/frameworks/kio/-/merge_requests/2057
Comment 1 Nate Graham 2025-11-17 20:36:33 UTC

*** This bug has been marked as a duplicate of bug 479350 ***