Bug 509231

Summary: Dolphin moves folder from 'places' to current folder with drag+drop
Product: [Applications] dolphin Reporter: BOF <bugs_kde_org.5.kuru>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED FIXED    
Severity: critical CC: dolphin-bugs-null, nate
Priority: NOR    
Version First Reported In: 25.08.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.21
Sentry Crash Report:
Attachments: bug 509231 - demo

Description BOF 2025-09-07 14:19:31 UTC
SUMMARY
Folders that are clicked & dragged from the side panel ("Places") are moved to the place where they are dropped. If "Drag and Drop" in the settings (General Bahavior -> Drag and Drop) is set to "Move if on same device", dolphin will not even ask before moving it.

STEPS TO REPRODUCE
1. Open dolphin
2. Drag any folder from the "places" list to any other location
3. Click on the folder linked in "places" ... "annnddd It's Gone"

OBSERVED RESULT
If you click on the linked path in "places" the folder behind the link is *moved* to the location where the link is dropped. The link in the "Places" list itself stays in place. The (custom) icon of the folder is removed.

EXPECTED RESULT
DO NOTHING! (Literally do nothing. If you want to remove the link you can right click and use the context menu)
If I drag the link I may expect to remove the link from the "Places" list. I may expect to create a link to the folder. I would never expect that the folder is *moved*.

ADDITIONAL INFORMATION
Example video will be uploaded once rendering is finished.

I discovered this by accidentally moving the folder. As the folder just had the name, but no custom icon, I didn't think that the folder was *moved* as it doesn't make any sense to me. Because I did neither need a copy nor a linked version of the folder I (Shift + Delete)d the folder. A few seconds later I realised that the folder was not copied or linked and that the link in "Places" just gives me a red bar at the top and a friendly note that the path no longer exists. Thankfully the folder itself just contained linked files and folders so they are easy to restore. Now image if it was your homework folder!
Because the behaviour is so unexpected and just asks for serious trouble, I set the bug to "critical" even there is nothing 'broken'. Feel free to change the severity to a different level.
If there really is a need for this behaviour (which I kinda disagree) it should be an option that is OFF by default. If the option the bahaviour is optional but ON by default (which I *strongly* disagree with) the link should be removed from the list with drag&drop to at least indicate that you have just done something to the folder.

SOFTWARE/OS VERSIONS
Operating System: KDE neon User Edition
KDE Plasma Version: 6.4.4
KDE Frameworks Version: 6.17.0
Qt Version: 6.9.1
Kernel Version: 6.14.0-29-generic (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 7530U with Radeon Graphics
Memory: 32 GiB of RAM (29.2 GiB usable)
Graphics Processor: AMD Radeon Graphics
Manufacturer: LENOVO
Product Name: 21KK
System Version: ThinkBook 16 G6 ABP

Dolphin Version: 25.08.0
Comment 1 BOF 2025-09-07 15:49:52 UTC
Created attachment 184787 [details]
bug 509231 - demo

Video with steps to reproduce the bug
Comment 2 Bug Janitor Service 2025-12-05 13:26:40 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/2074
Comment 3 Nate Graham 2025-12-10 05:44:20 UTC
Git commit 8e6cfd3b6a7e55777208d3c5755ffefcb56d4098 by Nate Graham, on behalf of Rafał Lichwała.
Committed on 10/12/2025 at 05:44.
Pushed by ngraham into branch 'master'.

kfileplacesview: remove DropAction::MoveAction from the list of supportedActions

When we drag some item from "Places View" and drop it to some other destination
folder, there is `DropAction::MoveAction` allowed (on the drop popup menu) which
makes the source item is physically moved to destination folder and it is removed
from the source (but not from "Places View", so user even does not know the item
has been removed).


This commit corrects this behavior in two aspects:

1. It removes `DropAction::MoveAction` from the list of `supportedActions` in `KFilePlacesView::startDrag` method
2. It prevents putting plugin custom actions to drop popup menu as they can have
also Move-like destructive consequences

Now, when we drag some item from "Places View" to any other folder we just have
"Copy" and "Link" default actions in drop popup menu. Even when "Move by default"
setting is set, such drop popup menu is always displayed (and does not contain
Move-like actions).
FIXED-IN: 6.21

M  +3    -1    autotests/dropjobtest.cpp
M  +8    -1    src/filewidgets/kfileplacesview.cpp
M  +12   -1    src/widgets/dropjob.cpp

https://invent.kde.org/frameworks/kio/-/commit/8e6cfd3b6a7e55777208d3c5755ffefcb56d4098