diff options
author | Srinivasa Ragavan <sragavan@novell.com> | 2006-09-29 14:21:52 +0800 |
---|---|---|
committer | Srinivasa Ragavan <sragavan@src.gnome.org> | 2006-09-29 14:21:52 +0800 |
commit | 0e5cccbd8a13b407422e2c1bdd2f3228bc87506b (patch) | |
tree | 94b86d06fc36f0ed6f02705b3d793b34140a84c6 /widgets | |
parent | 067b04518cc4be31f74f77ccc2ee6ba59abc3e8d (diff) | |
download | gsoc2013-evolution-0e5cccbd8a13b407422e2c1bdd2f3228bc87506b.tar.gz gsoc2013-evolution-0e5cccbd8a13b407422e2c1bdd2f3228bc87506b.tar.zst gsoc2013-evolution-0e5cccbd8a13b407422e2c1bdd2f3228bc87506b.zip |
** Fixes bug #341474 patch from Ushveen
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.
svn path=/trunk/; revision=32820
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/misc/ChangeLog | 7 | ||||
-rw-r--r-- | widgets/misc/e-attachment-bar.c | 23 |
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; } |