Bug 309740 - Details view incorrectly shows huge filesize (16 EiB) for updated files in subfolders (details mode).
Summary: Details view incorrectly shows huge filesize (16 EiB) for updated files in su...
Alias: None
Product: dolphin
Classification: Applications
Component: view-engine: details mode (show other bugs)
Version: 2.1
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: Dolphin Bug Assignee
Keywords: reproducible, testcase
Depends on:
Reported: 2012-11-08 10:16 UTC by Nikita Skovoroda
Modified: 2013-05-22 16:12 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.10.4

A screenshot. (11.85 KB, image/png)
2012-11-08 10:16 UTC, Nikita Skovoroda

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