Make thunar display recursive file size

Bug #1419545 reported by alexxcons
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Thunar File Manager
Confirmed
Wishlist
thunar (Ubuntu)
Triaged
Wishlist
Unassigned

Bug Description

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 memory, it's always a pain to right-click 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) , that's why I would disable the feature on default and allow to enable it in the thunar-preferences.

If you agree with me, I would take care for the implementation and provide a patch.

Revision history for this message
alexxcons (alexander.schwinn) wrote :

I would like to mark this bug as a feature request ... however I have no idea how I can do so.

Changed in thunar (Ubuntu):
assignee: nobody → Derek Freder (acs82)
Revision history for this message
Thaddaeus Tintenfisch (thad-fisch-deactivatedaccount) wrote :

Please forward this feature request and potential patches to the Xfce bug tracker.

https://bugzilla.xfce.org/

You can write to the mailing list also and discuss your idea.

https://mail.xfce.org/mailman/listinfo/xfce4-dev

Revision history for this message
Thomas Ward (teward) wrote :

Marking as "Wishlist" and "Triaged" per feature-request triage guidelines.

However, we have a situation here where this bug is 'assigned'. Unless you are working on a debdiff or such for this, or are assigned to handle building out of this, you should not assign this bug to yourself (per the triage guidelines and such).

As well., as Thaddaeus makes a note, you should file this feature request and potential patches to the XFCE bugtracker upstream - it's likely to end up there before it ends up in any Ubuntu version.

Changed in thunar (Ubuntu):
assignee: Derek Freder (acs82) → nobody
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
In , alexxcons (alexander.schwinn) wrote :

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.

Revision history for this message
alexxcons (alexander.schwinn) wrote :

 Ok, thanks for the info & thanks for fixing things ! I sent a mail to the mailing list & opened a bug in the xfce bugzilla:
https://bugzilla.xfce.org/show_bug.cgi?id=11524

Changed in thunar:
importance: Unknown → Wishlist
status: Unknown → Confirmed
Revision history for this message
In , André Miranda (andreldm) wrote :

Moving to the correct product.

Revision history for this message
In , Alexandra-ardnaxela (alexandra-ardnaxela) wrote :

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.

Revision history for this message
In , Woiling (woiling) wrote :

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.

Revision history for this message
In , Woiling (woiling) wrote :

You also might want to have a look on #10338

Revision history for this message
In , Woiling (woiling) wrote :
Revision history for this message
In , alexxcons (alexander.schwinn) wrote :

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!

Revision history for this message
In , Woiling (woiling) wrote :

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 :-)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.