I have 1 file named "3333" and 1 folder named "1231" in current folder. I'm trying to rename file to folder's name "1231". In the dialog "name exists" I press "cancel" button. After it I see two files named "1231" until I reload (press F5) folder contents. Reproducible: Always
Thanks for the bug report, I can confirm this problem. Very strange, but I hope it's not hard to fix.
The problem is that DolphinView::slotRoleEditingFinished() changes the file name in KFitemModel before KonqOperations::rename() (the function which does the actual renaming and shows the dialog if necessary) gets called. I think there's no good way to find out what KonqOperations::rename() actually did. I think the best way to fix this might be to check in DolphinView::slotRoleEditingFinished() if a file with a new name is already in the model and not call KFileItemModel::setData() in that case. The dir lister should notify the model then when the renaming has happened.
Resetting assignee to default as per bug #305719
*** Bug 307074 has been marked as a duplicate of this bug. ***
Created attachment 74069 [details] Work-in-progress patch This fixes it in principle, but leads to other problems because lots of "Already exists" dialogs pop up. Needs more work :-(
The bug only appears with inline renaming. Renaming the file with the Rename Dialog works fine for me.
Yes, that's because the DolphinView updates the file name only in the "Rename inline" case. When using the dialog, the file name update is done when we receive the dir lister's signal. I think my patch from comment 5 might work fine if the "multiple signal connections/no disconnections" issue that we're discussing in https://git.reviewboard.kde.org/r/107070/ is resolved.
Git commit 7cff47b01254f35bf413eac5d9d336f77c6f5fd9 by Frank Reininghaus. Committed on 31/10/2012 at 23:06. Pushed by freininghaus into branch 'KDE/4.9'. Do not show an incorrect file name after a failed rename operation FIXED-IN: 4.9.3 M +12 -3 dolphin/src/views/dolphinview.cpp http://commits.kde.org/kde-baseapps/7cff47b01254f35bf413eac5d9d336f77c6f5fd9