Bug 509150 - Dolphin Size column counts two extra items for directories with >=200 entries
Summary: Dolphin Size column counts two extra items for directories with >=200 entries
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
: 436743 511601 513998 516904 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-09-05 13:23 UTC by leouscin
Modified: 2026-05-13 10:40 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description leouscin 2025-09-05 13:23:34 UTC
Dolphin's "Size" column counts two extra items when a directory has 200 or more entries. The Information panel shows the correct number of items.

Steps to reproduce:
1. Create a directory with 199 empty files (for example using `mkdir -p ~/tmp/repro_199 && seq -w 199 | xargs -I{} touch ~/tmp/repro_199/f_{}`).
2. Create another directory with 200 empty files (`mkdir -p ~/tmp/repro_200 && seq -w 200 | xargs -I{} touch ~/tmp/repro_200/f_{}`).
3. Open the parent directory containing these folders in Dolphin and switch to Details view so the Size column shows the number of items.
4. Note that `repro_199` shows 199 items in both the Size column and the Information panel.
5. Note that `repro_200` shows 202 items in the Size column but 200 items in the Information panel. Similarly, a directory with 331 files shows 333 items in the Size column and 331 in the Information panel.

Expected behaviour:
The Size column should report the actual number of items, consistent with the Information panel and `find -maxdepth 1` output.

Additional information:
- OS: Arch Linux (Plasma 6) as of September 2025.
- Dolphin version: current Arch package.
- The bug is not related to hidden files or the '.'/ '..' entries, since it occurs with plain directories containing only regular files.
- The threshold appears to be exactly 200 entries; directories with fewer than 200 files are counted correctly.
Comment 1 Dragoon Aethis 2025-09-20 19:22:09 UTC
Can confirm the same on latest Arch with Dolphin/KDE Apps 25.08.1-1, Frameworks 6.18.0-1, qt6-base 6.9.2-1. I have a directory with 1402 items (no hidden files, dot dirs, etc) and it also shows 2 extra files.
Comment 2 aristsakas 2025-12-25 23:59:56 UTC
*** Bug 511601 has been marked as a duplicate of this bug. ***
Comment 3 Bug Janitor Service 2025-12-26 03:03:19 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/1135
Comment 4 Tylerebowers 2025-12-31 02:47:46 UTC
*** Bug 513998 has been marked as a duplicate of this bug. ***
Comment 5 aristsakas 2026-01-01 12:51:54 UTC
*** Bug 436743 has been marked as a duplicate of this bug. ***
Comment 6 Trần Nam Tuấn (Bill) 2026-03-01 17:12:16 UTC
*** Bug 516904 has been marked as a duplicate of this bug. ***
Comment 7 Méven 2026-05-13 10:40:30 UTC
Git commit 914cd9010b52125a01e607c0b0f08401be225106 by Méven Car, on behalf of Pan Zhang.
Committed on 13/05/2026 at 10:40.
Pushed by meven into branch 'master'.

kfileitemmodelrolesupdater: fix directory item count for large folders

Dolphin reported an incorrect item count in the "Size" column for directories containing 200 or more entries.

Use KIO::ListJob::ListFlag::ExcludeDotAndDotDot and ExcludeHidden to filter entries at the source.

Use a local counter (totalCount) captured via std::shared_ptr in the lambda to ensure each scan job starts from zero and maintains its own state.

Add a fast path using list.size() when showDirectoriesOnly is false to improve performance.

M  +25   -21   src/kitemviews/kfileitemmodelrolesupdater.cpp

https://invent.kde.org/system/dolphin/-/commit/914cd9010b52125a01e607c0b0f08401be225106