Bug 407509 - "File already exists" dialog does not show up when you try to rename a file using the name of a file already present on desktop
Summary: "File already exists" dialog does not show up when you try to rename a file u...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 6.4.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: PanZhang
URL:
Keywords:
: 470333 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-05-13 20:08 UTC by Patrick Silva
Modified: 2025-09-05 05:47 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.18
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2019-05-13 20:08:57 UTC
STEPS TO REPRODUCE
1. set your desktop do folder view layout
2. copy two files of the same type to desktop
3. try to rename one of the two files using the same name as the other file that you copied to desktop

OBSERVED RESULT
plasma shows the error message "Could not rename file..."

EXPECTED RESULT
plasma shows the same "File already exists" dialog that appears when you follow the steps 2 and 3 using Dolphin

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.15.5
KDE Frameworks Version: 5.57.0
Qt Version: 5.13.0 beta3
Comment 1 Kai Uwe Broulik 2019-05-23 15:18:17 UTC
Dolphin uses KIO::moveAs which prompts to rename if already exists, whereas Folder View goes through KDirModel which uses KIO::rename which complains when it already exists and doesn't work when direct rename isn't possible.
I guess KDirModel should be changed?
Comment 2 Patrick Silva 2023-05-27 13:15:37 UTC
*** Bug 470333 has been marked as a duplicate of this bug. ***
Comment 3 yushuoqi 2025-08-18 08:14:00 UTC
@pan You can look at this question first.
Comment 4 Bug Janitor Service 2025-08-27 02:14:40 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1981
Comment 5 PanZhang 2025-08-27 02:21:19 UTC
I have reproduced the issue and submitted a merge request.
Comment 6 Akseli Lahtinen 2025-09-05 05:47:15 UTC
Git commit e2869783a06c4a31a7f636b861f79bdffd8d79f8 by Akseli Lahtinen, on behalf of Pan Zhang.
Committed on 05/09/2025 at 05:32.
Pushed by akselmo into branch 'master'.

KDirModel: use moveAs instead of Rename when editing file name
When renaming a file on the desktop to an existing filename, the operation previously failed with a generic error instead of showing the expected "file already exists" dialog. This change ensures consistent behavior with renaming in the file manager.
FIXED-IN: 6.18

M  +2    -1    src/widgets/kdirmodel.cpp

https://invent.kde.org/frameworks/kio/-/commit/e2869783a06c4a31a7f636b861f79bdffd8d79f8