Fix Bug 319119 - Dolphin doesn't notice when renaming failed
Review Request #110922 - Created June 9, 2013 and submitted
Change the data in the model before the real renaming is done by KonqOperations::rename(), but when the rename operation fails, revert the data changes in the model. The problem is that DolphinView::slotRoleEditingFinished() changes the data in the model *before* the actual renaming is performed by KonqOperations/KIO. But we need this approach for the following cases: * Immediate feedback from the users point of view (No delay between finish renaming and DolphinView updates) * Missing file system/dir lister signals, when there is no file system notification system (ftp, ssh, ...) A lot of code in konq_operations.h and konq_operations.cpp is just copy and paste, to guarantee binary compatibility. (added some TODOs for KF 5.0)
Works for me. Tested with a remote ssh file system on a virtual machine.
I don't like the duplication very much (can't the old method call the V2 method, if the only difference is the return value, which the old method would then ignore?). Otherwise OK, as it's kind of temporary anyway. It just increases the risks of someone fixing a bug in one copy and not the other, so if we can avoid the duplication, it's better.
Review request changed
Let the old rename methods call the new renameV2 methods to avoid code duplication, but ignore the return values to guarantee binary compatibility. Moved the RENAME flag to the end of the Operation list.
Revision 2 (+73 -8)
Thanks for looking into this, Emmanuel! I'm looking forward to having one little annoyance less :-) The Dolphin side of the patch looks good to me, and I can confirm that it works nicely.