[GSoC 22] Add file count to size column for directories
This MR aims to add the count of the files contained in a directory to the size column of that directory in the column view. (#61 (closed))
TODO
-
Initial port of patch -
Add three way option for synchronously counting number of files in a folder (always, local files only, never) -
Make remote files show sizes instead of (0 items) if set to 'local files only' -
Switch to async counting in another thread using ThunarJob
Merge request reports
Activity
- Resolved by Pratyaksh Gautam
I had tried to use an async function to enumerate the files in the folder first and then within the callback change the value by passing it, but it segfaults when I access the
value
pointer, which is supposed to point to the string in the size column.I want to try instead by instead updating a property of something (a ThunarListModel?) to reflect the file count once it has been enumerated, and then using the notify signal on this to update the text on the size column. The issue is that the size column in the
thunar_list_model_get_value
function sets theGValue
to a string, and I don't know where this get value function is actually used to reflect the number of items in the size column. I'm thinking that I needvalue
to point to a GObject instead so that I can connect the signal to it.Where is the list model actually used to make the list view in the thunar source, and do you think the above approach is sensible?
- Resolved by Pratyaksh Gautam
I've tried to set up a binding between
misc-items-count-as-dir-sizes
and the three way label box for the preference. I used some transformation functions (transform_dirsize_string_to_enum
, andtransform_dirsize_enum_to_string
) that I pass tog_object_bind_property_full
. I picked this up on the basis of a similar binding being set up in thunar-preferences-dialog.c:353In the function in
thunar-preferences-dialog
too, a combo box is used, and the transformation function usesg_value_get_string
to get the string from theGValue
, but doing the same in my transformation function raises the error(lt-thunar:165999): GLib-GObject-CRITICAL **: 14:59:18.102: g_value_get_string: assertion 'G_VALUE_HOLDS_STRING (value)' failed
added 1 commit
- 95424f5f - Fix the size column showing 0 items in some cases
added 1 commit
- d6dc2c5a - Fix the size column showing 0 items in some cases
added 1 commit
- 80c01922 - Fix the size column showing 0 items in some cases
added 323 commits
-
80c01922...ff927e81 - 312 commits from branch
xfce:master
- 09b94e24 - Port patch for item count in size column
- d3ba3a98 - Temporarily remove file count caching
- 964c646b - Add async file enumeration (not working)
- a6a46e90 - Revert "Add async file enumeration (not working)"
- 038c9f91 - Revert "Temporarily remove file count caching"
- 1e1eb4f8 - Add enum for ThunarItemsAsFolderSize
- cf5f1fce - Add three option box for number of items in size column for folders
- bd9a63c2 - [WIP] Add binding between properties
- 95e83aae - Fix bug with property binding of combo box
- f12101ea - Add working option for dir size column
- 3e2ceec7 - Fix the size column showing 0 items in some cases
Toggle commit list-
80c01922...ff927e81 - 312 commits from branch
- Resolved by Pratyaksh Gautam
Rebased onto master, I think it should be mergeable now. The three options work as expected. It is worth noting that counting items for a remote directory before loading it of course introduces an overhead as one would expect.
- Resolved by Pratyaksh Gautam
- Resolved by Pratyaksh Gautam
- Resolved by Pratyaksh Gautam
- Resolved by Pratyaksh Gautam
- Resolved by Pratyaksh Gautam