Bug 319119 - Dolphin doesn't notice when renaming failed
Summary: Dolphin doesn't notice when renaming failed
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Unclassified
Component: view-engine: general (show other bugs)
Version: 2.2
Platform: Other Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-30 14:21 UTC by Kai Uwe Broulik
Modified: 2013-06-16 10:59 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.11


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Uwe Broulik 2013-04-30 14:21:27 UTC
When inline-renaming a file and renaming fails (in this case: "Too many connections from this IP" error), Dolphin doesn't notice it and shows the new name and doesn't let you rename the file again until you refresh the view.

Reproducible: Always

Steps to Reproduce:
1. Open a remote location
2. Try to rename file "foo" to file "bar" (and somehow make it fail by pluggin out the cable or so)
3. 
Actual Results:  
File is still shown as "bar" and pressing F2 or using the Rename context menu entry doesn't work

Expected Results:  
File is shown as "foo"

I guess this only happens if the renaming itself fails, if Dolphin knows in beforehand that you cannot rename it (ie. insufficient permissions) it doesn't even enter edit more in the first place.
Comment 1 Frank Reininghaus 2013-05-24 09:10:18 UTC
Yes, confirmed. The problem is that DolphinView::slotRoleEditingFinished() changes the data in the model *before* the actual renaming is performed by KonqOperations/KIO. We could in principle remove the call

m_model->setData(index, data)

and wait for the notification from the dir lister telling us that the file name has changed, but this approach would have two different problems:

(a) After finishing inline renaming, the old name reappears for a brief moment until the dir lister's signal is received.

(b) If there is nothing like inotify that tells the dir lister about changes in the file system (like when viewing remote folders and renaming items there), the name would not be updated at all.

Therefore, fixing it is not straightforward and is probably not possible without modifications in KonqOperations and/or KIO.
Comment 2 Emmanuel Pescosta 2013-06-10 16:45:13 UTC
Git commit 0d0b9583daedce0eec06e18db1c8533d26bffe78 by Emmanuel Pescosta.
Committed on 10/06/2013 at 11:16.
Pushed by emmanuelp into branch 'master'.

Fix Bug 319119 - Dolphin doesn't notice when renaming failed

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.
REVIEW: 110922

M  +14   -1    dolphin/src/views/dolphinview.cpp
M  +2    -0    dolphin/src/views/dolphinview.h
M  +27   -5    lib/konq/konq_operations.cpp
M  +30   -1    lib/konq/konq_operations.h

http://commits.kde.org/kde-baseapps/0d0b9583daedce0eec06e18db1c8533d26bffe78