Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Consistent file size units #108

Open
luigifab opened this issue Feb 8, 2024 · 2 comments
Open

Request: Consistent file size units #108

luigifab opened this issue Feb 8, 2024 · 2 comments
Labels
help wanted Any C programmers out there? patch feature request A "nice to have" patch to complement the classic experience

Comments

@luigifab
Copy link
Contributor

luigifab commented Feb 8, 2024

What should be patched?

With Caja there is an option to display 1 k = 1024 octets.
Run caja-file-management-properties and go to Display tab (IEC units).

I have a file of 803404 octets / 1024 k = 784,6.
File size is good in caja list view, but file size "is incorrect" in open/save dialog.

The idea, read the configuration of caja-file-management-properties, then use it to display file size in open/save dialog.

Screenshots

1

Commits

I don't know.

@luigifab luigifab added help wanted Any C programmers out there? patch feature request A "nice to have" patch to complement the classic experience labels Feb 8, 2024
@lah7 lah7 changed the title Request: Inconsistent file size Request: Consistent file size units Feb 8, 2024
@lah7
Copy link
Owner

lah7 commented Feb 8, 2024

Apparently, it's up to each application to decide IEC vs SI units. Using this Reddit comment as a hint, the line to be patched is most likely:

$ grep -r 'g_format_size'
gtk/gtkfilechooserwidget.c:        g_value_take_string (value, g_format_size (g_file_info_get_size (info)));

Historically, GNOME preferred SI units (1 MB == 1000 kB):

Comment 8 mentions g_format_size_for_display(), maybe that's the change needed to show the other unit?

For a permanent patch to be accepted, ideally this should be configurable via an environment variable, like GTK_FILE_PICKER_IEC_UNITS=1.

@luigifab
Copy link
Contributor Author

luigifab commented Feb 9, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Any C programmers out there? patch feature request A "nice to have" patch to complement the classic experience
Projects
None yet
Development

No branches or pull requests

2 participants