Bug 50527

Summary: "delete file" undo does not work always
Product: [Applications] konqueror Reporter: Thomas Rehfinger <thomas.rehfinger>
Component: generalAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

Description Thomas Rehfinger 2002-11-10 19:27:25 UTC
Version:            (using KDE KDE 3.0.4)
Installed from:    SuSE RPMs

Hi!

Quite odd. To reproduce:

1. In konqueror, create a file "test", then move this file to trash. Now press Undo (ctrl-Z). A window pops up displaying the error message "Malformed URL", the undo operation failed.

2. Now create the file "test" again, move it to trash again, choose "overwrite" in the following dialog, then press Undo (ctrl-Z). The undo operation succeeds!

3. Delete "test" (with shift-DEL), repeat step 1. The undo operation will fail again.
Comment 1 Thomas Rehfinger 2002-12-15 13:44:08 UTC
Perfectly reproducable with KDE3.1-RC5 
 
Comment 2 David Faure 2003-04-01 22:28:58 UTC
Subject: kdelibs/kio/kio

CVS commit by faure: 

Patch based on a good analysis of #50527 by Pascal Letourneau:
Use the correct destination URL in the copyingDone signal when moving a file,
so that undoing works.
CCMAIL: 50527-done@bugs.kde.org


  M +5 -5      job.cpp   1.341


--- kdelibs/kio/kio/job.cpp  #1.340:1.341
@@ -2840,10 +2840,10 @@ void CopyJob::slotResult( Job *job )
             subjobs.remove( job );
             assert ( subjobs.isEmpty() );
-            if ( err )
-            {
                 // Determine dest again
                 KURL dest = m_dest;
                 if ( destinationState == DEST_IS_DIR && !m_asMethod )
                     dest.addPath( m_currentSrcURL.fileName() );
+            if ( err )
+            {
                 // Direct renaming didn't work. Try renaming to a temp name,
                 // this can help e.g. when renaming 'a' to 'A' on a VFAT partition.
@@ -2895,5 +2895,5 @@ void CopyJob::slotResult( Job *job )
             {
                 //kdDebug(7007) << "Renaming succeeded, move on" << endl;
-                emit copyingDone( this, *m_currentStatSrc, m_currentDest, true, true );
+                emit copyingDone( this, *m_currentStatSrc, dest, true, true );
                 ++m_currentStatSrc;
                 statNextSrc();