! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Make thunar display recursive file size
Status:
RESOLVED: MOVED
Severity:
enhancement

Comments

Description alexxcons editbugs 2015-02-09 19:22:40 CET
For me it would be nice to have the option to enable recursive file-size display in the default-view of thunar.
When searching why a bunch of nested folders needs so much disk-space, it's always a pain to "right-click-->properties" each single folder and its sub-folders to see the total size. ( As painful as using du + cd in the console )
For this use-case it would be much more convenient to directly see the total-size in the thunar default-view.

I am aware of the ext4 / inode problem ( circular file-system references) in which the size-checking would end up in a infinite loop, displaying "... checking file size" forever.
However I think this would be no problem. It's just a special-case and should be treat as that.

In any case, the attempt to display the total size ( which will succeed in 99% of the cases ) is more informative than always display the same 4.0 KB on each folder.

If you dont like the idea to have the recursive-file-size per default, we could add a flag in the thunar-preferences in order to enable it. ( Personally I would vote for having the feature as default )

If you agree with the idea, and weather it should be the default behavior, I would start the implementation and provide a patch.
Comment 1 Andre Miranda editbugs 2015-02-22 04:55:17 CET
Moving to the correct product.
Comment 2 Alexandra 2015-04-28 14:48:48 CEST
I'm not a part of the dev team but I'd appreciate it a lot!
So far I always use "du -sh" within the terminal.
Comment 3 Woi 2015-04-29 22:37:54 CEST
I would welcome this Feature as well. Add two additional votes for my mum and my girlfriend if you like. Both are non-technical users and won't use the terminal.

Regarding the implementation and corner cases: You could have a look on the code of other file managers.
Comment 4 Woi 2015-04-29 22:40:56 CEST
You also might want to have a look on #10338
Comment 5 Woi 2015-04-29 22:41:42 CEST
bug 10338
Comment 6 alexxcons editbugs 2015-05-24 18:47:06 CEST
Created attachment 6281 
a first, incomplete patch

Currently I dont have much time to do the coding ( new baby + we move to a new house )
So here what I did so far. (patch for Thunar-1.6.3 attached). It already works nicely .. however there is a list of things which are TODO in order to ensure that it works in all cases, with the best performance, etc.

What currently works:
- For each folder of a tab, a deep-count-job is started to count the total size of the folder. Updates are displayed, until the total size is calculated.
- The jobs are cancelled when the directory, displayed by the tab is changed.
- If two tabs show the same folder, recursive size calculations are only done once
- The feature can be enabled /disabled in the preferences

What still needs to be done:
- Not realy good to run one job per folder, if this spawns a thread for each job ... could get a real problem for folders with many sub-folders
- save folder-sizes in tree-model for all sub-folders if possible (So that calculation is done only once when browsing a tree )
- Possible to use "thunar-folder" instead of "thunar-file" in order to save calculated size , etc ?
- move impl to separate file, if it makes sense
- bug: Update list-model if box in preferences is un-checked
- possibilitie to run all jobs in the same thread ?
- Usage of G_Likely / G_UNLikely 
- mutex protection for critical variables
- Possibility to refresh / re-calculate ? ( react on "reload" STR+R" .. maybe even automatically, if the size of an sub-folder/file is changed )
- Ensure that there are no memory-leaks !
- Usage of  g_object_ref, etc ? Does that make sense ?
- alphabetic order for methods ?
- update documentation
- create patch for trunk version of thunar (git ?)

Thanks alot to Woj, bug 10338 helped me alot to get started ! ( .. Probably my patch will conflict with the patch for bug 10338, since often it touches the same lines )

I will try to continue work on the patch, when I have free time however if it takes too long for you, feel free to take over!
Comment 7 Woi 2015-05-29 22:10:02 CEST
Hey Derek, 

thanks for starting to implement this. I'm happy my link to bug 10338 was useful. However I don't think I'm of much help if it comes down to coding. But I might assist with documentation, testing or translation.

But for the moment enjoy your time with the baby and new home :-)
Comment 8 Git Bot editbugs 2020-05-26 23:20:24 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/xfce/thunar/-/issues/94.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #11524

Reported by:
alexxcons
Reported on: 2015-02-09
Last modified on: 2020-05-26

People

Assignee:
Xfce Bug Triage
CC List:
5 users

Version

Version:
unspecified

Attachments

a first, incomplete patch (26.94 KB, patch)
2015-05-24 18:47 CEST , alexxcons
no flags

Additional information