[nautilus] file: use g_format_size_full instead of printf-ing the long string



commit 283e9b32cae61b5501ece85d1dacb1e1c29c4b85
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Jul 21 14:34:52 2011 -0400

    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.

 libnautilus-private/nautilus-file.c |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index 548f0c8..dc43614 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);
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]