make sure the description contains no empty lines.

2007-05-19  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpimagefile.c (gimp_imagefile_get_desc_string): make
	sure the description contains no empty lines.


svn path=/trunk/; revision=22540
This commit is contained in:
Michael Natterer 2007-05-19 20:09:56 +00:00 committed by Michael Natterer
parent d0e37946ed
commit 4884bc43fe
2 changed files with 30 additions and 6 deletions

View file

@ -1,3 +1,8 @@
2007-05-19 Michael Natterer <mitch@gimp.org>
* app/core/gimpimagefile.c (gimp_imagefile_get_desc_string): make
sure the description contains no empty lines.
2007-05-18 Sven Neumann <sven@gimp.org>
* plug-ins/common/screenshot.c: try to use the window name as

View file

@ -571,34 +571,42 @@ gimp_imagefile_get_desc_string (GimpImagefile *imagefile)
if (thumbnail->image_state == GIMP_THUMB_STATE_REMOTE)
{
g_string_append (str, _("Remote File"));
g_string_append_c (str, '\n');
}
if (thumbnail->image_filesize > 0)
{
gchar *size = gimp_memsize_to_string (thumbnail->image_filesize);
if (str->len > 0)
g_string_append_c (str, '\n');
g_string_append (str, size);
g_free (size);
g_string_append_c (str, '\n');
}
switch (thumbnail->thumb_state)
{
case GIMP_THUMB_STATE_NOT_FOUND:
if (str->len > 0)
g_string_append_c (str, '\n');
g_string_append (str, _("Click to create preview"));
break;
case GIMP_THUMB_STATE_EXISTS:
if (str->len > 0)
g_string_append_c (str, '\n');
g_string_append (str, _("Loading preview..."));
break;
case GIMP_THUMB_STATE_OLD:
if (str->len > 0)
g_string_append_c (str, '\n');
g_string_append (str, _("Preview is out of date"));
break;
case GIMP_THUMB_STATE_FAILED:
if (str->len > 0)
g_string_append_c (str, '\n');
g_string_append (str, _("Cannot create preview"));
break;
@ -606,28 +614,39 @@ gimp_imagefile_get_desc_string (GimpImagefile *imagefile)
{
if (thumbnail->image_state == GIMP_THUMB_STATE_REMOTE)
{
if (str->len > 0)
g_string_append_c (str, '\n');
g_string_append (str, _("(Preview may be out of date)"));
g_string_append_c (str, '\n');
}
if (thumbnail->image_width > 0 && thumbnail->image_height > 0)
{
if (str->len > 0)
g_string_append_c (str, '\n');
g_string_append_printf (str,
ngettext ("%d × %d pixel",
"%d × %d pixels",
thumbnail->image_height),
thumbnail->image_width,
thumbnail->image_height);
g_string_append_c (str, '\n');
}
if (thumbnail->image_type)
g_string_append (str, gettext (thumbnail->image_type));
{
if (str->len > 0)
g_string_append_c (str, '\n');
g_string_append (str, gettext (thumbnail->image_type));
}
if (thumbnail->image_num_layers > 0)
{
if (thumbnail->image_type)
g_string_append_len (str, ", ", 2);
else if (str->len > 0)
g_string_append_c (str, '\n');
g_string_append_printf (str,
ngettext ("%d layer",