diff --git a/app/core/gimpitem.c b/app/core/gimpitem.c index 321b996574..51c5285fe7 100644 --- a/app/core/gimpitem.c +++ b/app/core/gimpitem.c @@ -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); diff --git a/app/core/gimpitempropundo.c b/app/core/gimpitempropundo.c index 3f95ecb6ce..9a07905574 100644 --- a/app/core/gimpitempropundo.c +++ b/app/core/gimpitempropundo.c @@ -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; diff --git a/app/core/gimpitemtree.c b/app/core/gimpitemtree.c index bd0423604d..761b977aa6 100644 --- a/app/core/gimpitemtree.c +++ b/app/core/gimpitemtree.c @@ -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); } diff --git a/app/core/gimpitemtree.h b/app/core/gimpitemtree.h index d75e5381ed..4a3cdc294e 100644 --- a/app/core/gimpitemtree.h +++ b/app/core/gimpitemtree.h @@ -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);