Bug 477187 - Option to disable calculating the size and number of items in child directories
Summary: Option to disable calculating the size and number of items in child directories
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-18 14:17 UTC by random011
Modified: 2024-03-07 15:19 UTC (History)
5 users (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 random011 2023-11-18 14:17:02 UTC
SUMMARY
***
This is more of feature request. I am looking for an option to be added that let's you fully disable calculating the size, as well as the number of items in child folders in the current directory that you're in. Basically, just list the folders that are in it, without doing anything with them. For the files in the directory, of course, the sizes would still be listed.

The feature to count the number of items is very inefficient when you're dealing with a high capacity HDD with a lot of files in it. Plus, even with my SSDs, I'd rather not have something use them more than they should be used.

When this option is enabled it should automatically disable/ignore Settings > View modes > Details > Folder size displays, and it should work regardless of the current view mode. The size of directories would simply be listed as "0". 
***


STEPS TO REPRODUCE
1. Use dolphin

OBSERVED RESULT
Counts the number of items in child folders or calculates their size, unnecessarily using the storage unit.

EXPECTED RESULT
Option to fully stop counting the number of items in child folders (or calculate their size).

SOFTWARE/OS VERSIONS
Windows: Any
macOS: Any
Linux/KDE Plasma: Any
(available in About System)
KDE Plasma Version: Any
KDE Frameworks Version: Any
Qt Version: Any
Comment 1 joweo3 2023-12-28 18:28:55 UTC
I second this. Currently im using Dolphin 21.12.3 on xubuntu 22.04 and im having an issue where i have over 10k items in a folder, im looking at the parent folder and it keeps freezing and i cant refresh it without waiting for it to re-calculate the size of the child folder.

 (and ive tested this from 2 different SSD drives as well as a HDD drive so its not my drives) - granted this is probably a different bug, since i didnt have this issue when using Dolphin on xubuntu 20.04 few months ago.

Therefore Disabling this feature of counting or calculating the size of the folders would help stop this from happening.
Unless there is a way to force remove the option from a config file or something as a workaround?
Comment 2 random011 2023-12-29 07:00:53 UTC
(In reply to joweo3 from comment #1)
> I second this. Currently im using Dolphin 21.12.3 on xubuntu 22.04 and im
> having an issue where i have over 10k items in a folder, im looking at the
> parent folder and it keeps freezing and i cant refresh it without waiting
> for it to re-calculate the size of the child folder.
> 
>  (and ive tested this from 2 different SSD drives as well as a HDD drive so
> its not my drives) - granted this is probably a different bug, since i didnt
> have this issue when using Dolphin on xubuntu 20.04 few months ago.
> 
> Therefore Disabling this feature of counting or calculating the size of the
> folders would help stop this from happening.
> Unless there is a way to force remove the option from a config file or
> something as a workaround?

There is no workaround with config files. I've tried. In Dolphin settings I told it count the number of items at a max depth of 1 (which I think is the most efficient while having this feature on). Then in the config file I set it to a depth of 0. After that, even though Dolphin did not display the number of items in child folders, it continued doing the counting in the background anyway. I could tell my HDD spinning like crazy for no reason. A KDE dev told me that this feature is deeply integrated and can't be removed through this kind of trickery, hence why I posted this.
Comment 3 Joe 2023-12-30 22:26:31 UTC
(In reply to random011 from comment #0)
Same issue here. When navigating -nearby- directories with thousands of files, my dolphin will lock up entirely until it is able to scan through all of them. Granted, this happens while accessing a remote directory mounted using sshfs-fuse. But even still, when testing with PCManFM and Thunar, theyhave no loading or performance issues with navigating around the same folders.
It would be great if we had a way to disable the scanning behavior or perhaps manually initiate/omit specific folders.  The existing functionality works fine as long as there are not a crazy amount of files in nearby directories. Perhaps an adjustable limit to how many files it tries to scan before giving up?
Comment 4 random011 2023-12-31 21:38:23 UTC
(In reply to Joe from comment #3)
> (In reply to random011 from comment #0)
> Same issue here. When navigating -nearby- directories with thousands of
> files, my dolphin will lock up entirely until it is able to scan through all
> of them. Granted, this happens while accessing a remote directory mounted
> using sshfs-fuse. But even still, when testing with PCManFM and Thunar,
> theyhave no loading or performance issues with navigating around the same
> folders.
> It would be great if we had a way to disable the scanning behavior or
> perhaps manually initiate/omit specific folders.  The existing functionality
> works fine as long as there are not a crazy amount of files in nearby
> directories. Perhaps an adjustable limit to how many files it tries to scan
> before giving up?

Personally I prefer to be able to stop it all together. I love how in Thunar the view mode, and everything else is global. Things like per-folder view preferences or other settings on a per-folder basis cause a messy config file in the long run and confusion.
Comment 5 random011 2023-12-31 21:42:27 UTC
(In reply to random011 from comment #4)
> (In reply to Joe from comment #3)
> > (In reply to random011 from comment #0)
> > Same issue here. When navigating -nearby- directories with thousands of
> > files, my dolphin will lock up entirely until it is able to scan through all
> > of them. Granted, this happens while accessing a remote directory mounted
> > using sshfs-fuse. But even still, when testing with PCManFM and Thunar,
> > theyhave no loading or performance issues with navigating around the same
> > folders.
> > It would be great if we had a way to disable the scanning behavior or
> > perhaps manually initiate/omit specific folders.  The existing functionality
> > works fine as long as there are not a crazy amount of files in nearby
> > directories. Perhaps an adjustable limit to how many files it tries to scan
> > before giving up?
> 
> Personally I prefer to be able to stop it all together. I love how in Thunar
> the view mode, and everything else is global. Things like per-folder view
> preferences or other settings on a per-folder basis cause a messy config
> file in the long run and confusion.

Not to mention the whole argument of where you should put that config file. In theory config files should not under any cirtumstance have identifiable information in them. So do you put it in ~/.config or ~/.local/share ? I'm not against per-folder settings being an options but not the default under any circumstance. If I set the view mode to details or icons I want it everywhere. Though in my case I almost always use details view, as it's way more useful. Especially if you name your files properly you would never need the icons view.
Comment 6 Bug Janitor Service 2024-03-02 17:27:17 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/726
Comment 7 tagwerk19 2024-03-03 06:29:54 UTC
(In reply to Joe from comment #3)
> ... When navigating -nearby- directories with thousands of
> files, my dolphin will lock up entirely until it is able to scan through all
> of them. Granted, this happens while accessing a remote directory mounted
> using sshfs-fuse ...
Might this be an instance of:
    https://invent.kde.org/plasma/plasma-desktop/-/issues/71
It seems strange that Dolphin blocks...
Comment 8 Méven Car 2024-03-04 09:16:01 UTC
We already have two ways to achieve a similar behavior:

 * remove the size column from the view. You will have to set the sorting column to a different one than size or dolphin will keep computing sizes and sort using that column
 * In settings > view > file size, select "file counting", this is very fast, no recursive.
Comment 9 Méven Car 2024-03-07 15:19:40 UTC
Git commit 815bb8d514d70d79ef5f3fd7fffa95850f761d55 by Méven Car, on behalf of Nico Kreipke.
Committed on 07/03/2024 at 15:11.
Pushed by meven into branch 'master'.

Add option to completely disable directory size counting

Dolphin shows the size of directories by listing their contents, which
for some users might cause unwanted load on the file system.
Depending on the size of the subdirectories in question and how the
storage is accessed, this might cause noticeable delays and even
freezing.

This commit adds a new option under "View -> Content Display" that
enables users to set "Folder size:" to "No size", completely disabling
directory size counting. Directory size counting is still enabled by
default.

As a third option for "Folder size" is added, the DirectorySizeCount
boolean setting is replaced with a DirectorySizeMode enum setting. The
old setting is migrated using a kconf_update script.
GUI:

M  +4    -1    doc/index.docbook
M  +2    -0    src/CMakeLists.txt
M  +2    -1    src/kitemviews/kfileitemlistwidget.cpp
M  +4    -3    src/kitemviews/kfileitemmodel.cpp
M  +2    -2    src/kitemviews/kfileitemmodelrolesupdater.cpp
M  +14   -3    src/settings/dolphin_contentdisplaysettings.kcfg
A  +10   -0    src/settings/dolphin_directorysizemode.py
A  +9    -0    src/settings/dolphin_directorysizemode.upd
M  +19   -11   src/settings/viewmodes/contentdisplaytab.cpp
M  +1    -0    src/settings/viewmodes/contentdisplaytab.h

https://invent.kde.org/system/dolphin/-/commit/815bb8d514d70d79ef5f3fd7fffa95850f761d55