use gimp_enum_get_value() to avoid string duplication.

2005-06-25  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpimagepropview.c (gimp_image_prop_view_update):
	use gimp_enum_get_value() to avoid string duplication.
This commit is contained in:
Sven Neumann 2005-06-25 17:01:50 +00:00 committed by Sven Neumann
parent 30564babb6
commit feadca6859
2 changed files with 12 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2005-06-25 Sven Neumann <sven@gimp.org>
* app/widgets/gimpimagepropview.c (gimp_image_prop_view_update):
use gimp_enum_get_value() to avoid string duplication.
2005-06-25 Karine Delvare <kdelvare@nerim.net>
* authors.xml: added Akkana Peck to contributors and updated my

View File

@ -275,6 +275,7 @@ gimp_image_prop_view_update (GimpImagePropView *view)
GimpUnit unit;
gdouble unit_factor;
gint unit_digits;
const gchar *desc;
gchar format_buf[32];
gchar buf[256];
@ -317,17 +318,18 @@ gimp_image_prop_view_update (GimpImagePropView *view)
/* color type */
type = gimp_image_base_type (image);
gimp_enum_get_value (GIMP_TYPE_IMAGE_BASE_TYPE, type,
NULL, NULL, &desc, NULL);
switch (type)
{
case GIMP_RGB:
g_snprintf (buf, sizeof (buf), "%s", _("RGB Color"));
break;
case GIMP_GRAY:
g_snprintf (buf, sizeof (buf), "%s", _("Grayscale"));
g_snprintf (buf, sizeof (buf), "%s", desc);
break;
case GIMP_INDEXED:
g_snprintf (buf, sizeof (buf), "%s (%d %s)",
_("Indexed Color"), image->num_cols, _("colors"));
g_snprintf (buf, sizeof (buf),
"%s (%d %s)", desc, image->num_cols, _("colors"));
break;
}