Bug 136876

Summary: Symlinks in trash should show symlink size, not file size.
Product: [Unmaintained] kio Reporter: Viesturs Zarins <viesturs.zarins>
Component: trashAssignee: David Faure <faure>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Viesturs Zarins 2006-11-05 10:47:27 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    Gentoo Packages

If i create a symlink of a large file and delete it later, the size of a symlink in trash is the size of the file the symlink links to.

I would expect the file sizes in trash to show how much space my trash takes up.

The correct behavior would be to show the symlink size which usually is about hundread bytes.
Comment 1 David Faure 2006-11-06 12:12:25 UTC
SVN commit 602619 by dfaure:

[Bug 136876] Symlinks in trash should show symlink size, not file size.
BUG: 136876


 M  +4 -0      kio_trash.cpp  


--- branches/KDE/3.5/kdebase/kioslave/trash/kio_trash.cpp #602618:602619
@@ -407,6 +407,9 @@
 
         addAtom( entry, KIO::UDS_LINK_DEST, 0, QFile::decodeName( buffer2 ) );
         // Follow symlink
+        // That makes sense in kio_file, but not in the trash, especially for the size
+        // #136876
+#if 0
         if ( KDE_stat( physicalPath_c, &buff ) == -1 ) {
             // It is a link pointing to nowhere
             buff.st_mode = S_IFLNK | S_IRWXU | S_IRWXG | S_IRWXO;
@@ -414,6 +417,7 @@
             buff.st_atime = 0;
             buff.st_size = 0;
         }
+#endif
     }
     mode_t type = buff.st_mode & S_IFMT; // extract file type
     mode_t access = buff.st_mode & 07777; // extract permissions