Bug 502766

Summary: Deleting a file to trash, when the selected file is being renamed, deletes the file below it.
Product: [Applications] dolphin Reporter: somethinglikethis <somethinglikethis1>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: major CC: john.kizer, kfm-devel
Priority: NOR    
Version First Reported In: 24.12.3   
Target Milestone: ---   
Platform: Flatpak   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description somethinglikethis 2025-04-14 00:27:31 UTC
Deleting a file to trash, when the selected file is being renamed, deletes the file below it.

Viewing the Trash after doing the following steps, results in a duplicate of the selected file being sent to the Trash, and the file below the selected file deleted. It vanishes.

STEPS TO REPRODUCE
Please set up a folder with test files. A minimum of two files must be within the directory.
1. I am using the Details view.
2. Click on a file, that has a file below it within the Details view.
3. Click on the name of the file, again, so that it initiates renaming the file.
4. In the time between clicking on the file, and the initiation of renaming the file: right click on the file.
5. You should now have the context menu open, whilst the file is being renamed. The context menu should be the same as when right-clicking a file normally: if you see the context menu for editing text, you right-clicked too late.
6. Select the Move to Trash option.
7. The selected file is not deleted, the file below it is deleted, and a duplicate of the selected file is sent to the Trash instead.

OBSERVED RESULT
Deleting a file in this manner results in data loss.

EXPECTED RESULT
This should delete the selected file only.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: Alpine Linux 6.14.0-0-edge, Flatpak Dolphin 24.12.3 (as installed from Flathub).
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 John Kizer 2025-04-14 07:00:16 UTC
Hi - if you press Escape after step 6, you should see that the file below the originally selected file, after the move to trash, is actually now the selected file - the inline renaming was not lined up correctly, though, which is the bug that I'm merging this in with.

Ex. if you have 01.txt and 02.txt, and you perform those steps on 01.txt - but press Escape after clicking Move to Trash - you'll find that you still have 02.txt in that folder, and 01.txt is in the Trash as expected.

Hope that helps clear things up!

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