app: trim out trailing whitespaces from item names.

Trailing whitespaces are a bother because they are not easily spotted
and there are no good reasons to have any on an item name.
This commit is contained in:
Jehan 2015-06-17 00:50:04 +02:00
parent 3b88a346f1
commit 123c605da7
1 changed files with 8 additions and 0 deletions

View File

@ -646,6 +646,14 @@ gimp_item_tree_uniquefy_name (GimpItemTree *tree,
gimp_object_set_name (GIMP_OBJECT (item), new_name);
}
/* Remove any trailing whitespace. */
if (gimp_object_get_name (item))
{
gchar *name = g_strchomp (g_strdup (gimp_object_get_name (item)));
gimp_object_take_name (GIMP_OBJECT (item), name);
}
if (g_hash_table_lookup (private->name_hash,
gimp_object_get_name (item)))
{