[gimp/gimp-2-10] app: don't emit GimpImage::linked-items-changed for non-attached items



commit 79b3fb5ce77e0817379a2c098004bbda132b8123
Author: Ell <ell_se yahoo com>
Date:   Sun Jan 19 20:48:41 2020 +0200

    app: don't emit GimpImage::linked-items-changed for non-attached items
    
    In gimp_item_set_linked(), don't emit the
    GimpImage::linked-items-changed signal if the item is not attached.
    
    (cherry picked from commit 1e26ce8a608bbd77aec9e4093679f618ddf701e7)

 app/core/gimpitem.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/app/core/gimpitem.c b/app/core/gimpitem.c
index d38b8e3ef2..6960d0b461 100644
--- a/app/core/gimpitem.c
+++ b/app/core/gimpitem.c
@@ -2334,16 +2334,17 @@ gimp_item_set_linked (GimpItem *item,
 
   if (gimp_item_get_linked (item) != linked)
     {
-      GimpImage *image = gimp_item_get_image (item);
+      GimpImage *image       = gimp_item_get_image (item);
+      gboolean   is_attached = gimp_item_is_attached (item);
 
-      if (push_undo && image && gimp_item_is_attached (item))
+      if (push_undo && is_attached && image)
         gimp_image_undo_push_item_linked (image, NULL, item);
 
       GET_PRIVATE (item)->linked = linked;
 
       g_signal_emit (item, gimp_item_signals[LINKED_CHANGED], 0);
 
-      if (image)
+      if (is_attached && image)
         gimp_image_linked_items_changed (image);
 
       g_object_notify (G_OBJECT (item), "linked");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]