Use gimp_item_tree_rename_item() also when undoing an item rename

so all item renaming goes through GimpItemTree API. Add "push_undo"
parameter to gimp_item_tree_rename_item().
This commit is contained in:
Michael Natterer 2010-02-07 15:56:53 +01:00
parent bcf7603e04
commit 2034a3676c
4 changed files with 11 additions and 3 deletions

View File

@ -474,7 +474,7 @@ gimp_item_real_rename (GimpItem *item,
{
if (gimp_item_is_attached (item))
gimp_item_tree_rename_item (gimp_item_get_tree (item), item,
new_name, undo_desc);
new_name, TRUE, undo_desc);
else
gimp_object_set_name (GIMP_OBJECT (item), new_name);

View File

@ -238,7 +238,12 @@ gimp_item_prop_undo_pop (GimpUndo *undo,
gchar *name;
name = g_strdup (gimp_object_get_name (item));
gimp_object_take_name (GIMP_OBJECT (item), item_prop_undo->name);
gimp_item_tree_rename_item (gimp_item_get_tree (item), item,
item_prop_undo->name,
FALSE, NULL);
g_free (item_prop_undo->name);
item_prop_undo->name = name;
}
break;

View File

@ -522,6 +522,7 @@ void
gimp_item_tree_rename_item (GimpItemTree *tree,
GimpItem *item,
const gchar *new_name,
gboolean push_undo,
const gchar *undo_desc)
{
GimpItemTreePrivate *private;
@ -537,7 +538,8 @@ gimp_item_tree_rename_item (GimpItemTree *tree,
if (strcmp (new_name, gimp_object_get_name (item)))
{
gimp_image_undo_push_item_rename (item->image, undo_desc, item);
if (push_undo)
gimp_image_undo_push_item_rename (item->image, undo_desc, item);
gimp_object_set_name (GIMP_OBJECT (item), new_name);
}

View File

@ -78,6 +78,7 @@ gboolean gimp_item_tree_reorder_item (GimpItemTree *tree,
void gimp_item_tree_rename_item (GimpItemTree *tree,
GimpItem *item,
const gchar *new_name,
gboolean push_undo,
const gchar *undo_desc);