Bug 658467 - Replace g_format_size_for_display() by g_format_size()

Use g_format_size() instead of g_format_size_for_display() because
the latter is deprecated.
This commit is contained in:
Michael Natterer 2011-09-13 11:39:24 +02:00
parent 6cff213038
commit 9781aa65ea
13 changed files with 23 additions and 27 deletions

View File

@ -169,7 +169,7 @@ edit_undo_clear_cmd_callback (GtkAction *action,
memsize += gimp_object_get_memsize (GIMP_OBJECT (redo_stack), &guisize);
memsize += guisize;
size = g_format_size_for_display (memsize);
size = g_format_size (memsize);
gimp_message_box_set_text (GIMP_MESSAGE_DIALOG (dialog)->box,
_("Clearing the undo history of this "

View File

@ -720,7 +720,7 @@ gimp_imagefile_get_desc_string (GimpImagefile *imagefile)
if (thumbnail->image_filesize > 0)
{
gchar *size = g_format_size_for_display (thumbnail->image_filesize);
gchar *size = g_format_size (thumbnail->image_filesize);
if (str->len > 0)
g_string_append_c (str, '\n');

View File

@ -320,14 +320,14 @@ image_new_confirm_dialog (ImageNewDialog *data)
G_CALLBACK (image_new_confirm_response),
data);
size = g_format_size_for_display (gimp_template_get_initial_size (data->template));
size = g_format_size (gimp_template_get_initial_size (data->template));
gimp_message_box_set_primary_text (GIMP_MESSAGE_DIALOG (dialog)->box,
_("You are trying to create an image "
"with a size of %s."), size);
g_free (size);
config = GIMP_GUI_CONFIG (data->context->gimp->config);
size = g_format_size_for_display (config->max_new_image_size);
size = g_format_size (config->max_new_image_size);
gimp_message_box_set_text (GIMP_MESSAGE_DIALOG (dialog)->box,
_("An image of the chosen size will use more "
"memory than what is configured as "

View File

@ -234,13 +234,13 @@ image_scale_confirm_large (ImageScaleDialog *dialog,
GtkWidget *widget = image_scale_confirm_dialog (dialog);
gchar *size;
size = g_format_size_for_display (new_memsize);
size = g_format_size (new_memsize);
gimp_message_box_set_primary_text (GIMP_MESSAGE_DIALOG (widget)->box,
_("You are trying to create an image "
"with a size of %s."), size);
g_free (size);
size = g_format_size_for_display (max_memsize);
size = g_format_size (max_memsize);
gimp_message_box_set_text (GIMP_MESSAGE_DIALOG (widget)->box,
_("Scaling the image to the chosen size will "
"make it use more memory than what is "

View File

@ -311,11 +311,8 @@ gimp_display_shell_format_title (GimpDisplayShell *shell,
GimpObject *object = GIMP_OBJECT (image);
gchar *str;
str = g_format_size_for_display (gimp_object_get_memsize (object,
NULL));
str = g_format_size (gimp_object_get_memsize (object, NULL));
i += print (title, title_len, i, "%s", str);
g_free (str);
}
break;

View File

@ -301,8 +301,7 @@ static void
gimp_image_prop_view_label_set_memsize (GtkWidget *label,
GimpObject *object)
{
gchar *str = g_format_size_for_display (gimp_object_get_memsize (object,
NULL));
gchar *str = g_format_size (gimp_object_get_memsize (object, NULL));
gtk_label_set_text (GTK_LABEL (label), str);
g_free (str);
}
@ -339,7 +338,7 @@ gimp_image_prop_view_label_set_filesize (GtkWidget *label,
if (g_stat (filename, &buf) == 0)
{
gchar *str = g_format_size_for_display (buf.st_size);
gchar *str = g_format_size (buf.st_size);
gtk_label_set_text (GTK_LABEL (label), str);
g_free (str);
@ -396,7 +395,7 @@ gimp_image_prop_view_label_set_undo (GtkWidget *label,
gchar *str;
gchar buf[256];
str = g_format_size_for_display (gimp_object_get_memsize (object, NULL));
str = g_format_size (gimp_object_get_memsize (object, NULL));
g_snprintf (buf, sizeof (buf), "%d (%s)", steps, str);
g_free (str);

View File

@ -650,7 +650,7 @@ gimp_template_editor_template_notify (GimpTemplate *template,
}
#ifdef ENABLE_MEMSIZE_LABEL
text = g_format_size_for_display (gimp_template_get_initial_size (template));
text = g_format_size (gimp_template_get_initial_size (template));
gtk_label_set_text (GTK_LABEL (private->memsize_label), text);
g_free (text);
#endif

View File

@ -725,7 +725,7 @@ gimp_thumb_box_auto_thumbnail (GimpThumbBox *box)
gchar *size;
gchar *text;
size = g_format_size_for_display (thumb->image_filesize);
size = g_format_size (thumb->image_filesize);
text = g_strdup_printf ("%s\n%s",
size, _("Creating preview..."));

View File

@ -71,7 +71,7 @@ gimp_memsize_get_type (void)
* Creates a string representation of a given memory size. This string
* can be parsed by gimp_memsize_deserialize() and can thus be used in
* config files. It should not be displayed to the user. If you need a
* nice human-readable string please use g_format_size_for_display().
* nice human-readable string please use g_format_size().
*
* Return value: A newly allocated string representation of @memsize.
*
@ -162,14 +162,14 @@ gimp_memsize_deserialize (const gchar *string,
* gimp_memsize_to_string:
* @memsize: A memory size in bytes.
*
* This function is deprecated! Use g_format_size_for_display() instead.
* This function is deprecated! Use g_format_size() instead.
*
* Return value: A newly allocated human-readable, translated string.
**/
gchar *
gimp_memsize_to_string (guint64 memsize)
{
return g_format_size_for_display (memsize);
return g_format_size (memsize);
}

View File

@ -202,7 +202,7 @@ background_jpeg_save (PreviewPersistent *pp)
g_stat (pp->file_name, &buf);
size_text = g_format_size_for_display (buf.st_size);
size_text = g_format_size (buf.st_size);
text = g_strdup_printf (_("File size: %s"), size_text);
gtk_label_set_text (GTK_LABEL (preview_size), text);

View File

@ -224,8 +224,8 @@ uri_progress_callback (goffset current_num_bytes,
if (total_num_bytes > 0)
{
const gchar *format;
gchar *done = g_format_size_for_display (current_num_bytes);
gchar *total = g_format_size_for_display (total_num_bytes);
gchar *done = g_format_size (current_num_bytes);
gchar *total = g_format_size (total_num_bytes);
switch (progress->mode)
{
@ -251,7 +251,7 @@ uri_progress_callback (goffset current_num_bytes,
else
{
const gchar *format;
gchar *done = g_format_size_for_display (current_num_bytes);
gchar *done = g_format_size (current_num_bytes);
switch (progress->mode)
{

View File

@ -123,14 +123,14 @@ progress_callback (void *clientp,
if (dltotal > 0.0)
{
memsize = g_format_size_for_display (dltotal);
memsize = g_format_size (dltotal);
gimp_progress_set_text_printf (_("Downloading %s of image data"),
memsize);
gimp_progress_update (dlnow / dltotal);
}
else
{
memsize = g_format_size_for_display (dlnow);
memsize = g_format_size (dlnow);
gimp_progress_set_text_printf (_("Downloaded %s of image data"),
memsize);
gimp_progress_pulse ();

View File

@ -357,7 +357,7 @@ uri_backend_load_image (const gchar *uri,
/* Start the actual download... */
if (size > 0)
{
memsize = g_format_size_for_display (size);
memsize = g_format_size (size);
message = g_strdup_printf (_("Downloading %s of image data"),
memsize);
}
@ -398,7 +398,7 @@ uri_backend_load_image (const gchar *uri,
}
else
{
memsize = g_format_size_for_display (kilobytes * 1024);
memsize = g_format_size (kilobytes * 1024);
gimp_progress_set_text_printf
(_("Downloaded %s of image data"), memsize);