diff options
author | Stefano Karapetsas <[email protected]> | 2014-01-27 16:23:13 +0100 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2014-01-27 16:23:13 +0100 |
commit | 7fbadf79122f06e80dd52937bfec8dea36cc2581 (patch) | |
tree | 8c974568176e1644df7416b67a41b44c348ee2f7 /src/file-manager/fm-properties-window.c | |
parent | d21e8d13f08a3c6cc89bec5e49ee4f76749ac89a (diff) | |
download | caja-7fbadf79122f06e80dd52937bfec8dea36cc2581.tar.bz2 caja-7fbadf79122f06e80dd52937bfec8dea36cc2581.tar.xz |
Add option to show file sizes with IEC units instead of SI units
Contains also a typo fix for the previous commit
Closes #203
https://github.com/mate-desktop/caja/issues/203
Diffstat (limited to 'src/file-manager/fm-properties-window.c')
-rw-r--r-- | src/file-manager/fm-properties-window.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c index f74ca6ca..d348a08a 100644 --- a/src/file-manager/fm-properties-window.c +++ b/src/file-manager/fm-properties-window.c @@ -2321,7 +2321,10 @@ directory_contents_value_field_update (FMPropertiesWindow *window) char *size_str; #if GLIB_CHECK_VERSION(2, 30, 0) - size_str = g_format_size(total_size); + if (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_USE_IEC_UNITS)) + size_str = g_format_size_full (total_size, G_FORMAT_SIZE_IEC_UNITS); + else + size_str = g_format_size(total_size); #else size_str = g_format_size_for_display(total_size); #endif @@ -3144,9 +3147,16 @@ create_pie_widget (FMPropertiesWindow *window) GFileInfo *info; #if GLIB_CHECK_VERSION(2, 30, 0) - capacity = g_format_size(window->details->volume_capacity); - free = g_format_size(window->details->volume_free); - used = g_format_size(window->details->volume_capacity - window->details->volume_free); + if (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_USE_IEC_UNITS)) { + capacity = g_format_size_full(window->details->volume_capacity, G_FORMAT_SIZE_IEC_UNITS); + free = g_format_size_full(window->details->volume_free, G_FORMAT_SIZE_IEC_UNITS); + used = g_format_size_full(window->details->volume_capacity - window->details->volume_free, G_FORMAT_SIZE_IEC_UNITS); + } + else { + capacity = g_format_size(window->details->volume_capacity); + free = g_format_size(window->details->volume_free); + used = g_format_size(window->details->volume_capacity - window->details->volume_free); + } #else capacity = g_format_size_for_display(window->details->volume_capacity); free = g_format_size_for_display(window->details->volume_free); |