aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--widgets/misc/ChangeLog7
-rw-r--r--widgets/misc/e-attachment-bar.c23
2 files changed, 11 insertions, 19 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog
index a6c99bddc5..615912f4e8 100644
--- a/widgets/misc/ChangeLog
+++ b/widgets/misc/ChangeLog
@@ -1,3 +1,10 @@
+2006-09-29 Srinivasa Ragavan <sragavan@novell.com>
+
+ ** Fixes bug #341474 patch from Ushveen
+
+ * e-attachment-bar.c: (size_to_string): Use
+ gnome_vfs_format_file_size_for_display instead of manual calculations.
+
2006-09-12 Ushveen Kaur <kushveen@novell.com>
** Fix for bug #325614
diff --git a/widgets/misc/e-attachment-bar.c b/widgets/misc/e-attachment-bar.c
index 708a365549..b4b3ef9fe5 100644
--- a/widgets/misc/e-attachment-bar.c
+++ b/widgets/misc/e-attachment-bar.c
@@ -89,31 +89,16 @@ static void update (EAttachmentBar *bar);
static char *
-size_to_string (size_t size)
+size_to_string (gulong size)
{
char *size_string;
/* FIXME: The following should probably go into a separate module, as
we might have to do the same thing in other places as well. Also,
I am not sure this will be OK for all the languages. */
-
- if (size < 1e3L) {
- size_string = NULL;
- } else {
- gdouble displayed_size;
-
- if (size < 1e6L) {
- displayed_size = (gdouble) size / 1.0e3;
- size_string = g_strdup_printf (_("%.0fK"), displayed_size);
- } else if (size < 1e9L) {
- displayed_size = (gdouble) size / 1.0e6;
- size_string = g_strdup_printf (_("%.0fM"), displayed_size);
- } else {
- displayed_size = (gdouble) size / 1.0e9;
- size_string = g_strdup_printf (_("%.0fG"), displayed_size);
- }
- }
-
+
+ size_string = gnome_vfs_format_file_size_for_display (size);
+
return size_string;
}