gvfs r1921 - in trunk: . monitor/hal
- From: gicmo svn gnome org
- To: svn-commits-list gnome org
- Subject: gvfs r1921 - in trunk: . monitor/hal
- Date: Mon, 1 Sep 2008 10:53:00 +0000 (UTC)
Author: gicmo
Date: Mon Sep 1 10:53:00 2008
New Revision: 1921
URL: http://svn.gnome.org/viewvc/gvfs?rev=1921&view=rev
Log:
Use g_format_size_for_display (Bug #550100)
Modified:
trunk/ChangeLog
trunk/monitor/hal/ghalvolume.c
Modified: trunk/monitor/hal/ghalvolume.c
==============================================================================
--- trunk/monitor/hal/ghalvolume.c (original)
+++ trunk/monitor/hal/ghalvolume.c Mon Sep 1 10:53:00 2008
@@ -136,35 +136,6 @@
return FALSE;
}
-#define KILOBYTE_FACTOR 1000.0
-#define MEGABYTE_FACTOR (1000.0 * 1000.0)
-#define GIGABYTE_FACTOR (1000.0 * 1000.0 * 1000.0)
-
-static char *
-format_size_for_display (guint64 size)
-{
- char *str;
- gdouble displayed_size;
-
- if (size < MEGABYTE_FACTOR)
- {
- displayed_size = (double) size / KILOBYTE_FACTOR;
- str = g_strdup_printf (_("%.1f kB"), displayed_size);
- }
- else if (size < GIGABYTE_FACTOR)
- {
- displayed_size = (double) size / MEGABYTE_FACTOR;
- str = g_strdup_printf (_("%.1f MB"), displayed_size);
- }
- else
- {
- displayed_size = (double) size / GIGABYTE_FACTOR;
- str = g_strdup_printf (_("%.1f GB"), displayed_size);
- }
-
- return str;
-}
-
static void
do_update_from_hal (GHalVolume *mv)
{
@@ -216,7 +187,7 @@
{
if (strcmp (volume_fsusage, "crypto") == 0 && strcmp (volume_fstype, "crypto_LUKS") == 0)
{
- size = format_size_for_display (volume_size);
+ size = g_format_size_for_display (volume_size);
/* Translators: %s is the size of the volume (e.g. 512 MB) */
name = g_strdup_printf (_("%s Encrypted Data"), size);
g_free (size);
@@ -239,7 +210,7 @@
}
else
{
- size = format_size_for_display (volume_size);
+ size = g_format_size_for_display (volume_size);
/* Translators: %s is the size of the volume (e.g. 512 MB) */
name = g_strdup_printf (_("%s Media"), size);
g_free (size);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]