commit 414cbf936ef2572f68e986251b6eed59375ef08f Author: Harald Judt Date: Thu Nov 15 15:29:12 2012 +0100 Use binary units instead of decimal units (e.g. KiB instead of kB). diff --git a/thunar/thunar-file.c b/thunar/thunar-file.c index 4c340f6..2235889 100644 --- a/thunar/thunar-file.c +++ b/thunar/thunar-file.c @@ -2098,7 +2098,7 @@ gchar * thunar_file_get_size_string (const ThunarFile *file) { _thunar_return_val_if_fail (THUNAR_IS_FILE (file), NULL); - return g_format_size (thunar_file_get_size (file)); + return g_format_size_full (thunar_file_get_size (file), G_FORMAT_SIZE_IEC_UNITS); } diff --git a/thunar/thunar-gio-extensions.c b/thunar/thunar-gio-extensions.c index c7d37fc..d140b86 100644 --- a/thunar/thunar-gio-extensions.c +++ b/thunar/thunar-gio-extensions.c @@ -420,8 +420,8 @@ thunar_g_file_get_free_space_string (GFile *file) if (thunar_g_file_get_free_space (file, &fs_free, &fs_size) && fs_size > 0) { - fs_free_str = g_format_size (fs_free); - fs_size_str = g_format_size (fs_size); + fs_free_str = g_format_size_full (fs_free, G_FORMAT_SIZE_IEC_UNITS); + fs_size_str = g_format_size_full (fs_size, G_FORMAT_SIZE_IEC_UNITS); /* free disk space string */ fs_string = g_strdup_printf (_("%s of %s (%d%% used)"), fs_free_str, fs_size_str, diff --git a/thunar/thunar-list-model.c b/thunar/thunar-list-model.c index 6c0d27b..dc1979d 100644 --- a/thunar/thunar-list-model.c +++ b/thunar/thunar-list-model.c @@ -2170,7 +2170,7 @@ thunar_list_model_get_statusbar_text (ThunarListModel *store, && thunar_g_file_get_free_space (thunar_file_get_file (file), &size, NULL))) { /* humanize the free space */ - fspace_string = g_format_size (size); + fspace_string = g_format_size_full (size, G_FORMAT_SIZE_IEC_UNITS); size_summary = 0; row = g_sequence_get_begin_iter (store->rows); @@ -2188,7 +2188,7 @@ thunar_list_model_get_statusbar_text (ThunarListModel *store, if (size_summary > 0) { /* generate a text which includes the size of all items in the folder */ - size_string = g_format_size (size_summary); + size_string = g_format_size_full (size_summary, G_FORMAT_SIZE_IEC_UNITS); text = g_strdup_printf (ngettext ("%d item (%s), Free space: %s", "%d items (%s), Free space: %s", nrows), nrows, size_string, fspace_string); g_free (size_string); @@ -2293,7 +2293,7 @@ thunar_list_model_get_statusbar_text (ThunarListModel *store, /* text for the items in the folder */ if (non_folder_count > 0) { - size_string = g_format_size (size_summary); + size_string = g_format_size_full (size_summary, G_FORMAT_SIZE_IEC_UNITS); if (folder_count > 0) { /* item count if there are also folders in the selection */ diff --git a/thunar/thunar-size-label.c b/thunar/thunar-size-label.c index eff53e7..64ac903 100644 --- a/thunar/thunar-size-label.c +++ b/thunar/thunar-size-label.c @@ -308,7 +308,7 @@ thunar_size_label_files_changed (ThunarSizeLabel *size_label) size = thunar_file_get_size (THUNAR_FILE (size_label->files->data)); /* setup the new label */ - size_string = g_format_size_full (size, G_FORMAT_SIZE_LONG_FORMAT); + size_string = g_format_size_full (size, G_FORMAT_SIZE_LONG_FORMAT | G_FORMAT_SIZE_IEC_UNITS); gtk_label_set_text (GTK_LABEL (size_label->label), size_string); g_free (size_string); } @@ -374,7 +374,7 @@ thunar_size_label_status_update (ThunarDeepCountJob *job, if (G_LIKELY (n > unreadable_directory_count)) { /* update the label */ - size_string = g_format_size (total_size); + size_string = g_format_size_full (total_size, G_FORMAT_SIZE_IEC_UNITS); text = g_strdup_printf (ngettext ("%u item, totalling %s", "%u items, totalling %s", n), n, size_string); g_free (size_string); diff --git a/thunar/thunar-transfer-job.c b/thunar/thunar-transfer-job.c index 8fa99a8..bb4669c 100644 --- a/thunar/thunar-transfer-job.c +++ b/thunar/thunar-transfer-job.c @@ -729,7 +729,7 @@ thunar_transfer_job_veryify_destination (ThunarTransferJob *transfer_job, free_space = g_file_info_get_attribute_uint64 (filesystem_info, G_FILE_ATTRIBUTE_FILESYSTEM_FREE); if (transfer_job->total_size > free_space) { - size_string = g_format_size (transfer_job->total_size - free_space); + size_string = g_format_size_full (transfer_job->total_size - free_space, G_FORMAT_SIZE_IEC_UNITS); succeed = thunar_job_ask_no_size (THUNAR_JOB (transfer_job), _("Error while copying to \"%s\": %s more space is " "required to copy to the destination"), @@ -1079,8 +1079,8 @@ thunar_transfer_job_get_status (ThunarTransferJob *job) status = g_string_sized_new (100); /* transfer status like "22.6MB of 134.1MB" */ - total_size_str = g_format_size (job->total_size); - total_progress_str = g_format_size (job->total_progress); + total_size_str = g_format_size_full (job->total_size, G_FORMAT_SIZE_IEC_UNITS); + total_progress_str = g_format_size_full (job->total_progress, G_FORMAT_SIZE_IEC_UNITS); g_string_append_printf (status, _("%s of %s"), total_progress_str, total_size_str); g_free (total_size_str); g_free (total_progress_str); @@ -1090,7 +1090,7 @@ thunar_transfer_job_get_status (ThunarTransferJob *job) && (job->last_update_time - job->start_time) > MINIMUM_TRANSFER_TIME) { /* remaining time based on the transfer speed */ - transfer_rate_str = g_format_size (job->transfer_rate); + transfer_rate_str = g_format_size_full (job->transfer_rate, G_FORMAT_SIZE_IEC_UNITS); remaining_time = (job->total_size - job->total_progress) / job->transfer_rate; if (remaining_time > 0)