Bug 309740

Summary: Details view incorrectly shows huge filesize (16 EiB) for updated files in subfolders (details mode).
Product: [Applications] dolphin Reporter: Nikita Skovoroda <chalkerx>
Component: view-engine: details modeAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: regi.hops
Priority: NOR Keywords: reproducible, testcase
Version: 2.1   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 4.10.4
Attachments: A screenshot.

Description Nikita Skovoroda 2012-11-08 10:16:11 UTC
When I am downloading a file, or the file is a log for something, or any other rapidly changing file, Dolphin details view incorrectly reports it's size as 16 EiB, if it is placed in a subfolder of the curretly opened folder.

You can see it on the screenshot.

Reproducible: Always

Steps to Reproduce:
1. Open dolphin in details view, create an empy folder for testing, navigate to it.
2. Open konsole in that folder.
Run: $ mkdir -p test; for i in `seq 1 1200`; do echo $i >> test/a.txt; echo $i >> b.txt; sleep 0.05; done;
3. While the above is running, refresh the folder (see another bug for the reason behind refreshing, i'll link to it), expand (without navigating to it) the «test» subfolder of that folder. 
4. Observe the reported size of a.txt
Actual Results:  
The reported size of the file «test/a.txt» is either 16 EiB, or is constantly changing between 16 EiB and the correct filesize back and forth.
«b.txt» is fine.

Expected Results:  
Dolphin should report the correct filesize, that the file had at some points of time.
I mean that if the filesize is lineary increasing from 0 bytes to 10000 bytes by 1 byte in a step, and the steps are quick enough, then «1 B, 10 B, 20 B, 31 B, 42 B, 50 B,…» is ok, but «1 B, 16 EiB, 20 B, 16 EiB, 31 B, 16 EiB, 42 B, 16 EiB, 50 B,…» is not ok.

That does not happen with a top-level folder, only with an expanded subfolder.
The size that's reported in the statusbar (when the file in question is hovered) is perfectly fine, it's not affected. Even for files in expanded subfolders.
Comment 1 Nikita Skovoroda 2012-11-08 10:16:48 UTC
Created attachment 75098 [details]
A screenshot.
Comment 2 Frank Reininghaus 2012-11-29 08:38:34 UTC
Thanks for the bug report! Confirmed in master.
Comment 3 regi.hops 2013-02-02 11:10:50 UTC
I see this also in the Dolphins "Timeline"-View for a recorded M2T-File.
In the details view it shows the correct size.
Comment 4 Frank Reininghaus 2013-05-22 16:12:48 UTC
Git commit 56cf52db901cf642b8f3219b24b395177ab9128f by Frank Reininghaus.
Committed on 22/05/2013 at 18:06.
Pushed by freininghaus into branch 'KDE/4.10'.

KFileItemModelRolesUpdater: only update the size for changed folders

When using inotify, we also receive signals for modified files, even if
we only ask KDirWatch to watch the directory containing them. In that
case, we must not set the size to -1 (which means "unknown number of
items" for folders) temporarily, or we end up with an apparent file size
of 2^64 - 1 bytes.
FIXED-IN: 4.10.4
REVIEW: 110428

M  +7    -0    dolphin/src/kitemviews/kfileitemmodelrolesupdater.cpp

http://commits.kde.org/kde-baseapps/56cf52db901cf642b8f3219b24b395177ab9128f