(*** This bug was imported into bugs.kde.org ***)
Version: KDE 2.0.1 \6
Installed from: RedHat RPMs
Compiler: Not Specified
OS/Compiler notes: Not Specified
Conqueror allows you to undo a copy operation even if the file has been modified.
When you do it the modified file is deleted and changes are lost forever.
A similar problem occurs when cutting: if you cut and paste a file and modify it and then you undo the paste operation the *modified* file is copied back into the original position!
Imho it should not be possible to undo a cut/copy/paste operation on a file if the file has been modified afterwards. It leads to incongrous and potentially dangerous behaviour so the corresponding menu item should be disabled.
Anyway congratulations for your wonderful work!
(Submitted via bugs.kde.org)
I can confirm this bug for konqueror 2.2.1 (RH 7.2)
Having a modified file copied to a different location does not result in loss
of data. However the following does:
* drag-and-drop copy a file to a new location (or the same location with a new
* modify the copied file in an external editor
* ctrl-z (Undo) in konqueror
--> modified file go bye-bye!
ACK. It's hard (if not impossible) to fix for cut though.
The only way I see to fix this for cut is to save a hash of the file.
and the fire up a messagebox then in case there is a mismatch when pasting you mean?
Confirmed for copy/undo in CVS HEAD from 5.11.03
Confirmed for KDE 3.3.0, Konqueror 3.3.
Wiped out 2 days worth of work! =)
Thanks for all the hard work!
2 days is a small price to pay for progress! =)
i can still verify this bug in current CVS HEAD (pre-3.4beta2)
Since this bug can cause data loss, doesn't it deserve a higher severity?
Related problem: Undoing a "create new -> file -> text file" (or similar) operation will delete the file even if modified with an external editor in between. Results in loss of data.
Proposal: you could provide redo functionality or throw the file in the trash instead of deleting it.
konqueror is high quality software anyway :)
*** Bug 140218 has been marked as a duplicate of this bug. ***
SVN commit 626835 by dfaure:
Fixed 6-years old bug 20532: Undoing a copy operation might delete a modified file causing loss of data.
A confirmation message box is shown when undoing a copy after modifying the file [this relies on copy preserving the mtime though, which might not be true for all protocols but we'll have to fix that].
The less severe case of move, modify, undo (no data loss, but the modified file is moved back) can't be fixed in all cases, since moving a whole directory can be done by a simple rename() call, so we have no information on all the files inside the directory. For single files it could be done though, but that's not implemented by this.
M +2 -2 kdebase/libkonq/konq_operations.cc
M +275 -212 kdebase/libkonq/konq_undo.cc
M +28 -5 kdebase/libkonq/konq_undo.h
M +30 -23 kdebase/libkonq/konq_undo_p.h
M +64 -17 kdebase/libkonq/tests/konqundomanagertest.cpp
M +6 -2 kdebase/libkonq/tests/konqundomanagertest.h
M +3 -5 kdebase/workspace/kcontrol/kfontinst/kcmfontinst/KCmFontInst.cpp
M +1 -1 kdebase/workspace/kcontrol/kfontinst/kcmfontinst/KCmFontInst.h
M +7 -6 kdelibs/kio/kio/copyjob.cpp
M +3 -1 kdelibs/kio/kio/copyjob.h