[gimp] app: remove "remove_children" parameter from gimp_image_item_list_filter()



commit 6d6efbbf8b4676a5ac556f9644c0fa755e52a790
Author: Michael Natterer <mitch gimp org>
Date:   Sat Jun 20 21:58:13 2015 +0200

    app: remove "remove_children" parameter from gimp_image_item_list_filter()
    
    It was always TRUE. The function should be renamed now, but not until
    the merging of linked item fixes to 2-8 is done.

 app/core/gimpimage-item-list.c    |   26 +++++++++++---------------
 app/core/gimpimage-item-list.h    |    3 +--
 app/core/gimpimage.c              |    2 +-
 app/core/gimpitem-linked.c        |   12 ++++++------
 app/tools/gimpeditselectiontool.c |   12 ++++++------
 5 files changed, 25 insertions(+), 30 deletions(-)
---
diff --git a/app/core/gimpimage-item-list.c b/app/core/gimpimage-item-list.c
index 8d25fa1..6e20938 100644
--- a/app/core/gimpimage-item-list.c
+++ b/app/core/gimpimage-item-list.c
@@ -241,8 +241,7 @@ gimp_image_item_list_remove_children (GList          *list,
 
 GList *
 gimp_image_item_list_filter (const GimpItem *exclude,
-                             GList          *list,
-                             gboolean        remove_children)
+                             GList          *list)
 {
   GList *l;
 
@@ -251,22 +250,19 @@ gimp_image_item_list_filter (const GimpItem *exclude,
   if (! list)
     return NULL;
 
-  if (remove_children)
-    {
-      if (exclude)
-        list = gimp_image_item_list_remove_children (list, exclude);
+  if (exclude)
+    list = gimp_image_item_list_remove_children (list, exclude);
 
-      for (l = list; l; l = g_list_next (l))
-        {
-          GimpItem *item = l->data;
-          GList    *next;
+  for (l = list; l; l = g_list_next (l))
+    {
+      GimpItem *item = l->data;
+      GList    *next;
 
-          next = gimp_image_item_list_remove_children (g_list_next (l), item);
+      next = gimp_image_item_list_remove_children (g_list_next (l), item);
 
-          l->next = next;
-          if (next)
-            next->prev = l;
-        }
+      l->next = next;
+      if (next)
+        next->prev = l;
     }
 
   return list;
diff --git a/app/core/gimpimage-item-list.h b/app/core/gimpimage-item-list.h
index b352505..85d52ec 100644
--- a/app/core/gimpimage-item-list.h
+++ b/app/core/gimpimage-item-list.h
@@ -52,8 +52,7 @@ GList * gimp_image_item_list_get_list  (const GimpImage        *image,
                                         GimpItemSet             set);
 
 GList * gimp_image_item_list_filter    (const GimpItem         *exclude,
-                                        GList                  *list,
-                                        gboolean                remove_children);
+                                        GList                  *list);
 
 
 #endif /* __GIMP_IMAGE_ITEM_LIST_H__ */
diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c
index 826b6d9..19fa26b 100644
--- a/app/core/gimpimage.c
+++ b/app/core/gimpimage.c
@@ -1711,7 +1711,7 @@ gimp_image_estimate_memsize (const GimpImage   *image,
                                              GIMP_ITEM_TYPE_CHANNELS,
                                              GIMP_ITEM_SET_ALL);
 
-  gimp_image_item_list_filter (NULL, drawables, TRUE);
+  gimp_image_item_list_filter (NULL, drawables);
 
   drawables = g_list_prepend (drawables, gimp_image_get_mask (image));
 
diff --git a/app/core/gimpitem-linked.c b/app/core/gimpitem-linked.c
index 7509c63..7030321 100644
--- a/app/core/gimpitem-linked.c
+++ b/app/core/gimpitem-linked.c
@@ -48,7 +48,7 @@ gimp_item_linked_is_locked (const GimpItem *item)
                                         GIMP_ITEM_TYPE_ALL,
                                         GIMP_ITEM_SET_LINKED);
 
-  list = gimp_image_item_list_filter (item, list, TRUE);
+  list = gimp_image_item_list_filter (item, list);
 
   for (l = list; l && ! locked; l = g_list_next (l))
     {
@@ -87,7 +87,7 @@ gimp_item_linked_translate (GimpItem *item,
                                         GIMP_ITEM_TYPE_ALL,
                                         GIMP_ITEM_SET_LINKED);
 
-  list = gimp_image_item_list_filter (item, list, TRUE);
+  list = gimp_image_item_list_filter (item, list);
 
   gimp_image_item_list_translate (gimp_item_get_image (item), list,
                                   offset_x, offset_y, push_undo);
@@ -113,7 +113,7 @@ gimp_item_linked_flip (GimpItem            *item,
                                         GIMP_ITEM_TYPE_ALL,
                                         GIMP_ITEM_SET_LINKED);
 
-  list = gimp_image_item_list_filter (item, list, TRUE);
+  list = gimp_image_item_list_filter (item, list);
 
   gimp_image_item_list_flip (gimp_item_get_image (item), list, context,
                              flip_type, axis, clip_result);
@@ -141,7 +141,7 @@ gimp_item_linked_rotate (GimpItem         *item,
                                         GIMP_ITEM_TYPE_VECTORS,
                                         GIMP_ITEM_SET_LINKED);
 
-  list = gimp_image_item_list_filter (item, list, TRUE);
+  list = gimp_image_item_list_filter (item, list);
 
   gimp_image_item_list_rotate (gimp_item_get_image (item), list, context,
                                rotate_type, center_x, center_y, clip_result);
@@ -152,7 +152,7 @@ gimp_item_linked_rotate (GimpItem         *item,
                                         GIMP_ITEM_TYPE_CHANNELS,
                                         GIMP_ITEM_SET_LINKED);
 
-  list = gimp_image_item_list_filter (item, list, TRUE);
+  list = gimp_image_item_list_filter (item, list);
 
   gimp_image_item_list_rotate (gimp_item_get_image (item), list, context,
                                rotate_type, center_x, center_y, TRUE);
@@ -181,7 +181,7 @@ gimp_item_linked_transform (GimpItem               *item,
                                         GIMP_ITEM_TYPE_ALL,
                                         GIMP_ITEM_SET_LINKED);
 
-  list = gimp_image_item_list_filter (item, list, TRUE);
+  list = gimp_image_item_list_filter (item, list);
 
   gimp_image_item_list_transform (gimp_item_get_image (item), list, context,
                                   matrix, direction,
diff --git a/app/tools/gimpeditselectiontool.c b/app/tools/gimpeditselectiontool.c
index dc1b31a..563f844 100644
--- a/app/tools/gimpeditselectiontool.c
+++ b/app/tools/gimpeditselectiontool.c
@@ -355,7 +355,7 @@ gimp_edit_selection_tool_start (GimpTool          *parent_tool,
                                                     GIMP_ITEM_TYPE_LAYERS,
                                                     GIMP_ITEM_SET_LINKED);
 
-            linked = gimp_image_item_list_filter (active_item, linked, TRUE);
+            linked = gimp_image_item_list_filter (active_item, linked);
 
             /*  Expand the rectangle to include all linked layers as well  */
             for (list = linked; list; list = g_list_next (list))
@@ -398,7 +398,7 @@ gimp_edit_selection_tool_start (GimpTool          *parent_tool,
                                                       GIMP_ITEM_TYPE_VECTORS,
                                                       GIMP_ITEM_SET_LINKED);
 
-              linked = gimp_image_item_list_filter (active_item, linked, TRUE);
+              linked = gimp_image_item_list_filter (active_item, linked);
 
               for (list = linked; list; list = g_list_next (list))
                 {
@@ -530,7 +530,7 @@ gimp_edit_selection_tool_button_release (GimpTool              *tool,
                                                       GIMP_ITEM_TYPE_CHANNELS,
                                                       GIMP_ITEM_SET_LINKED);
 
-              linked = gimp_image_item_list_filter (active_item, linked, TRUE);
+              linked = gimp_image_item_list_filter (active_item, linked);
 
               gimp_image_item_list_translate (image,
                                               linked,
@@ -662,7 +662,7 @@ gimp_edit_selection_tool_update_motion (GimpEditSelectionTool *edit_select,
                                                       GIMP_ITEM_TYPE_VECTORS,
                                                       GIMP_ITEM_SET_LINKED);
 
-              linked = gimp_image_item_list_filter (active_item, linked, TRUE);
+              linked = gimp_image_item_list_filter (active_item, linked);
 
               gimp_image_item_list_translate (image,
                                               linked,
@@ -875,7 +875,7 @@ gimp_edit_selection_tool_draw (GimpDrawTool *draw_tool)
                                                     GIMP_ITEM_TYPE_LAYERS,
                                                     GIMP_ITEM_SET_LINKED);
 
-            linked = gimp_image_item_list_filter (active_item, linked, TRUE);
+            linked = gimp_image_item_list_filter (active_item, linked);
 
             for (list = linked; list; list = g_list_next (list))
               {
@@ -924,7 +924,7 @@ gimp_edit_selection_tool_draw (GimpDrawTool *draw_tool)
                                                     GIMP_ITEM_TYPE_VECTORS,
                                                     GIMP_ITEM_SET_LINKED);
 
-            linked = gimp_image_item_list_filter (active_item, linked, TRUE);
+            linked = gimp_image_item_list_filter (active_item, linked);
 
             for (list = linked; list; list = g_list_next (list))
               {


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