Bug 212609 - wrong file size calculation for symbolic linked files
Summary: wrong file size calculation for symbolic linked files
Status: RESOLVED FIXED
Alias: None
Product: k3b
Classification: Applications
Component: general (show other bugs)
Version: 1.68.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Michał Małek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-01 12:40 UTC by newsscott
Modified: 2009-11-07 13:02 UTC (History)
1 user (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 newsscott 2009-11-01 12:40:24 UTC
Version:           1.68.0 (using KDE 4.3.2)
OS:                Linux
Installed from:    Ubuntu Packages

The file size shown in the list of selected files is ways to high if the file is a symbolic link and "follow symbolic links" is selected in the preferences.

Example: a 35MB file is shown as a 140.2 GiB (!) file if it is not added directly but via a symbolic link.
Comment 1 Michał Małek 2009-11-05 20:13:12 UTC
Hi, thanks for the report. It's strange indeed, unfortunately I cannot reproduce it. Could you provide more info on this?
Does it happen on new data project or on imported session?
Does a type of file the link is pointing to make any difference?
Comment 2 newsscott 2009-11-05 21:17:44 UTC
Hi Michał,

Thanks for asking. I just noticed the problem: The link i was using was a dead link, which i was not aware of. So here is how to reproduce:

$ ln -s /tmp/does_not_exist /tmp/bad_link

k3b: "New Data Project"
k3b: go to the project properties, tab "Filesystem", select "Symbolic Links" -> "Follow symlinks", Close
k3b: navigate to /tmp and add "bad_link" by mouse click

I agree, that this far away from normal use, well but it happend to me and it confused me. ;-)
Comment 3 Michał Małek 2009-11-05 22:09:57 UTC
Yes, now I can reproduce it. Well, it is a corner case but it is also certainly a bug :) Good catch.
Comment 4 Michał Małek 2009-11-07 13:02:00 UTC
SVN commit 1046059 by mmalek:

* Show size 0 for broken symlinks instead of some insanely huge number (data projects, "follow symbolic links" option enabled)
* Moved duplicated code from both constructors to the separate function init()
BUG: 212609

 M  +94 -90    k3bfileitem.cpp  
 M  +11 -4     k3bfileitem.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1046059