Bug 50527 - "delete file" undo does not work always
Summary: "delete file" undo does not work always
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-10 19:27 UTC by Thomas Rehfinger
Modified: 2003-04-01 22:28 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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();