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



commit 1e26ce8a608bbd77aec9e4093679f618ddf701e7
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.

 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 6d5f772242..5edaf3804b 100644
--- a/app/core/gimpitem.c
+++ b/app/core/gimpitem.c
@@ -2328,16 +2328,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]