Bug 105806 - moving files on same device via media:/ will copy&delete
Summary: moving files on same device via media:/ will copy&delete
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: media (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Kevin Ottens
URL:
Keywords:
: 105847 109895 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-05-17 12:30 UTC by Jens
Modified: 2006-06-16 00:28 UTC (History)
4 users (show)

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 Jens 2005-05-17 12:30:15 UTC
Version:            (using KDE 3.4.0 Level "b" , SUSE 9.3)
Compiler:          gcc version 3.3.5 20050117 (prerelease) (SUSE Linux)
OS:                Linux (i686) release 2.6.11.4-20a-default

Hi,

when I plug in a USB stick with a couple *large* files and try to _move_ them around on the stick, Konqueror starts to copy them - and then delete the originals.

This happens only if I use the media:/sda1 URL for the USB stick. If I browse manually to /media/usbdisk (I'm using SuSE 9.3) and move there everything works fine.

Please investigate this... thanks ;)

Jens
Comment 1 Kevin Ottens 2005-05-18 06:57:54 UTC
*** Bug 105847 has been marked as a duplicate of this bug. ***
Comment 2 Kevin Ottens 2005-06-03 17:27:46 UTC
SVN commit 421620 by ervin:

Resolve URLs using UDS_LOCAL_PATH before doing the real copy or move.
This way we avoid copy+delete when we just want to move from a device to
the same device (moving becomes instantaneous).

"approved by dfaure"(tm)

BUG:105806



 M  +14 -1     job.cpp  


--- trunk/KDE/kdelibs/kio/kio/job.cpp #421619:421620
@@ -2235,6 +2235,7 @@
     bool bDir = false;
     bool bLink = false;
     QString sName;
+    QString sLocalPath;
     UDSEntry::ConstIterator it2 = entry.begin();
     for( ; it2 != entry.end(); it2++ ) {
         if ( ((*it2).m_uds) == UDS_FILE_TYPE )
@@ -2243,6 +2244,8 @@
             bLink = !((*it2).m_str.isEmpty());
         else if ( ((*it2).m_uds) == UDS_NAME )
             sName = (*it2).m_str;
+        else if ( ((*it2).m_uds) == UDS_LOCAL_PATH )
+            sLocalPath = (*it2).m_str;
     }
 
     if ( destinationState == DEST_NOT_STATED )
@@ -2257,6 +2260,12 @@
         }
         if ( m_dest == d->m_globalDest )
             d->m_globalDestinationState = destinationState;
+
+        if ( !sLocalPath.isNull() ) {
+            m_dest = KURL();
+            m_dest.setPath(sLocalPath);
+        }
+	
         subjobs.remove( job );
         assert ( subjobs.isEmpty() );
 
@@ -2285,7 +2294,11 @@
     m_bCurrentSrcIsDir = false;
     slotEntries(job, lst);
 
-    KURL srcurl = ((SimpleJob*)job)->url();
+    KURL srcurl;
+    if (!sLocalPath.isNull())
+        srcurl.setPath(sLocalPath);
+    else
+        srcurl = ((SimpleJob*)job)->url();
 
     subjobs.remove( job );
     assert ( subjobs.isEmpty() ); // We should have only one job at a time ...
Comment 3 Sergio Martins 2005-08-02 01:48:52 UTC
why does kde 3.4.2 still have this bug? i thought it was fixed.

Another thing, when konqueror's at something like media://hdaX/Y and i press F4 to  open konsole, konsole opens with the prompt at ~ and not at the dir konqueror was at, i dont know if this is fixed in svn, if its not, tell me and i'll fill a bug report
Comment 4 Kevin Ottens 2005-08-02 06:52:08 UTC
Because I considered the modification a bit intrusive in KIO and didn't
backported it in the 3.4.x branch to ensure further testing. It'll be
in 3.5.x though.
Comment 5 Kevin Ottens 2005-08-02 06:53:15 UTC
Oh! As for F4, it's been fixed too in trunk, but was not backportable either.
Comment 6 Jens 2005-08-02 10:36:23 UTC
Yes, the F4 bug was reported in Bug 95644. Just FYI ;)
Comment 7 Kevin Ottens 2005-08-02 10:37:51 UTC
*** Bug 109895 has been marked as a duplicate of this bug. ***
Comment 8 Lee Braiden 2005-12-20 18:51:05 UTC
When viewing files on my flash drive with KPDF, it copies the entire PDF before opening too.  I assume this is related to the stuff above, so I'm just mentioning it here.  The fixes above don't seem to address the anything beyond file copy/moving though.  However, I could be wrong :)  If necessary, please create a new bug for this, or let me know so I can do it.
Comment 9 Lee Braiden 2005-12-20 18:51:42 UTC
p.s.: I'm using KDE 3.5 on (K)ubuntu.
Comment 10 Sergio Martins 2006-01-20 22:37:25 UTC
I'm still having this problem, and i'm using kde 3.5 on gentoo.
When i'm at media:/hdaX and i cut a large file and paste it in another location in the same device everything is great.

BUT if instead of cutting one big file i cut _two_ big files it takes a lot of time, like its copying to somewhere
Comment 11 S. Burmeister 2006-04-08 11:18:53 UTC
This is still an issue in some way. I just moved some 30 MB files to another dir on a USB-stick and KDe copied some couple of hundred kb according to the progress dialogue. After a few seconds and 1% of progress the dialogue closed and the files where moved.

I do not think that they were copied, but they were not only moved either since it took too long for that.

Maybe this bug should be re-opened.
Comment 12 S. Burmeister 2006-04-08 11:19:52 UTC
Forgot to mention, I did not use media:/ but system:/media/sda1/
Comment 13 David Faure 2006-06-16 00:28:46 UTC
It was still happening when moving more than one file or directory at a time.
Fixed now (see #112826).