summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2011-07-21 14:34:52 -0400
committerCosimo Cecchi <cosimoc@gnome.org>2011-07-21 14:37:55 -0400
commit283e9b32cae61b5501ece85d1dacb1e1c29c4b85 (patch)
tree8c7d34cb0271cd71badb750f3b75eef9239f7b43
parent3e69fb702393cf42486321c88cede4668329b4c8 (diff)
downloadnautilus-283e9b32cae61b5501ece85d1dacb1e1c29c4b85.tar.gz
file: use g_format_size_full instead of printf-ing the long string
Now that GLib has g_format_size_full(), we can easily format the long string (e.g. 45MB (45,123,456 bytes)) using it, instead of our custom printf function.
-rw-r--r--libnautilus-private/nautilus-file.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index 548f0c8a6..dc4361416 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -5831,9 +5831,6 @@ nautilus_file_get_size_as_string_with_real_size (NautilusFile *file)
{
guint item_count;
gboolean count_unreadable;
- char * formated;
- char * formated_plus_real;
- char * real_size;
if (file == NULL) {
return NULL;
@@ -5852,13 +5849,7 @@ nautilus_file_get_size_as_string_with_real_size (NautilusFile *file)
return NULL;
}
- formated = g_format_size (file->details->size);
- /* Do this in a separate stage so that we don't have to put G_GUINT64_FORMAT in the translated string */
- real_size = g_strdup_printf (_("%"G_GUINT64_FORMAT), (guint64) file->details->size);
- formated_plus_real = g_strdup_printf (_("%s (%s bytes)"), formated, real_size);
- g_free (real_size);
- g_free (formated);
- return formated_plus_real;
+ return g_format_size_full (file->details->size, G_FORMAT_SIZE_LONG_FORMAT);
}