[gimp/gimp-2-8] app: remove the "exclude" paameter from gimp_image_item_list_get_list()
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-8] app: remove the "exclude" paameter from gimp_image_item_list_get_list()
- Date: Sun, 28 Jun 2015 22:02:56 +0000 (UTC)
commit 7395e05614b0ecc42d5597396b39e3d88e5dd32e
Author: Michael Natterer <mitch gimp org>
Date: Sun Jun 28 23:48:47 2015 +0200
app: remove the "exclude" paameter from gimp_image_item_list_get_list()
and from gimp_image_item_list_filter(). After the fixes for bug 735906
it's no longer needed, and it was harmful.
(cherry picked from commit 3d7af8a184e06f2766f5584a22b46cc4bd7d7569)
Merging this to 2.8 is not strictly neccessary, but it's not unlikely
that linked layers are still slightly broken, so better have this
cleanup picked too.
app/core/gimpimage-item-list.c | 19 +++++--------------
app/core/gimpimage-item-list.h | 4 +---
app/core/gimpimage-resize.c | 2 +-
app/core/gimpimage-scale.c | 4 ++--
app/core/gimpitem-linked.c | 21 ++++++++++-----------
app/tools/gimpeditselectiontool.c | 28 ++++++++++++----------------
6 files changed, 31 insertions(+), 47 deletions(-)
---
diff --git a/app/core/gimpimage-item-list.c b/app/core/gimpimage-item-list.c
index e76c119..a44b932 100644
--- a/app/core/gimpimage-item-list.c
+++ b/app/core/gimpimage-item-list.c
@@ -153,18 +153,16 @@ gimp_image_item_list_transform (GimpImage *image,
/**
* gimp_image_item_list_get_list:
* @image: An @image.
- * @exclude: An item to exclude.
* @type: Which type of items to return.
* @set: Set the returned items are part of.
*
* This function returns a #GList of #GimpItem<!-- -->s for which the
* @type and @set criterions match.
*
- * Return value: The list of items, excluding @exclude.
+ * Return value: The list of items.
**/
GList *
gimp_image_item_list_get_list (const GimpImage *image,
- const GimpItem *exclude,
GimpItemTypeMask type,
GimpItemSet set)
{
@@ -173,7 +171,6 @@ gimp_image_item_list_get_list (const GimpImage *image,
GList *return_list = NULL;
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
- g_return_val_if_fail (exclude == NULL || GIMP_IS_ITEM (exclude), NULL);
if (type & GIMP_ITEM_TYPE_LAYERS)
{
@@ -183,7 +180,7 @@ gimp_image_item_list_get_list (const GimpImage *image,
{
GimpItem *item = list->data;
- if (item != exclude && gimp_item_is_in_set (item, set))
+ if (gimp_item_is_in_set (item, set))
return_list = g_list_prepend (return_list, item);
}
@@ -198,7 +195,7 @@ gimp_image_item_list_get_list (const GimpImage *image,
{
GimpItem *item = list->data;
- if (item != exclude && gimp_item_is_in_set (item, set))
+ if (gimp_item_is_in_set (item, set))
return_list = g_list_prepend (return_list, item);
}
@@ -213,7 +210,7 @@ gimp_image_item_list_get_list (const GimpImage *image,
{
GimpItem *item = list->data;
- if (item != exclude && gimp_item_is_in_set (item, set))
+ if (gimp_item_is_in_set (item, set))
return_list = g_list_prepend (return_list, item);
}
@@ -246,19 +243,13 @@ gimp_image_item_list_remove_children (GList *list,
}
GList *
-gimp_image_item_list_filter (const GimpItem *exclude,
- GList *list)
+gimp_image_item_list_filter (GList *list)
{
GList *l;
- g_return_val_if_fail (exclude == NULL || GIMP_IS_ITEM (exclude), NULL);
-
if (! list)
return NULL;
- if (exclude)
- list = gimp_image_item_list_remove_children (list, exclude);
-
for (l = list; l; l = g_list_next (l))
{
GimpItem *item = l->data;
diff --git a/app/core/gimpimage-item-list.h b/app/core/gimpimage-item-list.h
index ae17e98..6db374e 100644
--- a/app/core/gimpimage-item-list.h
+++ b/app/core/gimpimage-item-list.h
@@ -48,12 +48,10 @@ void gimp_image_item_list_transform (GimpImage *image,
GimpProgress *progress);
GList * gimp_image_item_list_get_list (const GimpImage *image,
- const GimpItem *exclude,
GimpItemTypeMask type,
GimpItemSet set);
-GList * gimp_image_item_list_filter (const GimpItem *exclude,
- GList *list);
+GList * gimp_image_item_list_filter (GList *list);
#endif /* __GIMP_IMAGE_ITEM_LIST_H__ */
diff --git a/app/core/gimpimage-resize.c b/app/core/gimpimage-resize.c
index 5731a2e..7fa77fc 100644
--- a/app/core/gimpimage-resize.c
+++ b/app/core/gimpimage-resize.c
@@ -85,7 +85,7 @@ gimp_image_resize_with_layers (GimpImage *image,
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_RESIZE,
C_("undo-type", "Resize Image"));
- resize_layers = gimp_image_item_list_get_list (image, NULL,
+ resize_layers = gimp_image_item_list_get_list (image,
GIMP_ITEM_TYPE_LAYERS,
layer_set);
diff --git a/app/core/gimpimage-scale.c b/app/core/gimpimage-scale.c
index b28e2d9..d58a207 100644
--- a/app/core/gimpimage-scale.c
+++ b/app/core/gimpimage-scale.c
@@ -281,12 +281,12 @@ gimp_image_scale_check (const GimpImage *image,
current_size = gimp_object_get_memsize (GIMP_OBJECT (image), NULL);
/* the part of the image's memsize that scales linearly with the image */
- drawables = gimp_image_item_list_get_list (image, NULL,
+ drawables = gimp_image_item_list_get_list (image,
GIMP_ITEM_TYPE_LAYERS |
GIMP_ITEM_TYPE_CHANNELS,
GIMP_ITEM_SET_ALL);
- gimp_image_item_list_filter (NULL, drawables);
+ drawables = gimp_image_item_list_filter (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 efee934..9d6dbd0 100644
--- a/app/core/gimpitem-linked.c
+++ b/app/core/gimpitem-linked.c
@@ -50,11 +50,11 @@ gimp_item_linked_translate (GimpItem *item,
image = gimp_item_get_image (item);
- items = gimp_image_item_list_get_list (image, NULL,
+ items = gimp_image_item_list_get_list (image,
GIMP_ITEM_TYPE_ALL,
GIMP_ITEM_SET_LINKED);
- items = gimp_image_item_list_filter (NULL, items);
+ items = gimp_image_item_list_filter (items);
gimp_image_item_list_translate (gimp_item_get_image (item), items,
offset_x, offset_y, push_undo);
@@ -79,10 +79,10 @@ gimp_item_linked_flip (GimpItem *item,
image = gimp_item_get_image (item);
- items = gimp_image_item_list_get_list (image, NULL,
+ items = gimp_image_item_list_get_list (image,
GIMP_ITEM_TYPE_ALL,
GIMP_ITEM_SET_LINKED);
- items = gimp_image_item_list_filter (NULL, items);
+ items = gimp_image_item_list_filter (items);
gimp_image_item_list_flip (image, items, context,
flip_type, axis, clip_result);
@@ -109,16 +109,16 @@ gimp_item_linked_rotate (GimpItem *item,
image = gimp_item_get_image (item);
- items = gimp_image_item_list_get_list (image, NULL,
+ items = gimp_image_item_list_get_list (image,
GIMP_ITEM_TYPE_LAYERS |
GIMP_ITEM_TYPE_VECTORS,
GIMP_ITEM_SET_LINKED);
- items = gimp_image_item_list_filter (NULL, items);
+ items = gimp_image_item_list_filter (items);
- channels = gimp_image_item_list_get_list (image, NULL,
+ channels = gimp_image_item_list_get_list (image,
GIMP_ITEM_TYPE_CHANNELS,
GIMP_ITEM_SET_LINKED);
- channels = gimp_image_item_list_filter (NULL, channels);
+ channels = gimp_image_item_list_filter (channels);
if (items && channels)
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TRANSFORM,
@@ -157,11 +157,10 @@ gimp_item_linked_transform (GimpItem *item,
image = gimp_item_get_image (item);
- items = gimp_image_item_list_get_list (image, NULL,
+ items = gimp_image_item_list_get_list (image,
GIMP_ITEM_TYPE_ALL,
GIMP_ITEM_SET_LINKED);
-
- items = gimp_image_item_list_filter (NULL, items);
+ items = gimp_image_item_list_filter (items);
gimp_image_item_list_transform (image, items, context,
matrix, direction,
diff --git a/app/tools/gimpeditselectiontool.c b/app/tools/gimpeditselectiontool.c
index 7be51db..a76171d 100644
--- a/app/tools/gimpeditselectiontool.c
+++ b/app/tools/gimpeditselectiontool.c
@@ -341,11 +341,10 @@ gimp_edit_selection_tool_start (GimpTool *parent_tool,
GList *linked;
GList *list;
- linked = gimp_image_item_list_get_list (image, NULL,
+ linked = gimp_image_item_list_get_list (image,
GIMP_ITEM_TYPE_LAYERS,
GIMP_ITEM_SET_LINKED);
-
- linked = gimp_image_item_list_filter (NULL, linked);
+ linked = gimp_image_item_list_filter (linked);
for (list = linked; list; list = g_list_next (list))
{
@@ -382,11 +381,10 @@ gimp_edit_selection_tool_start (GimpTool *parent_tool,
GList *linked;
GList *list;
- linked = gimp_image_item_list_get_list (image, NULL,
+ linked = gimp_image_item_list_get_list (image,
GIMP_ITEM_TYPE_VECTORS,
GIMP_ITEM_SET_LINKED);
-
- linked = gimp_image_item_list_filter (NULL, linked);
+ linked = gimp_image_item_list_filter (linked);
for (list = linked; list; list = g_list_next (list))
{
@@ -430,19 +428,19 @@ gimp_edit_selection_tool_start (GimpTool *parent_tool,
case GIMP_TRANSLATE_MODE_LAYER:
case GIMP_TRANSLATE_MODE_VECTORS:
edit_select->live_items =
- gimp_image_item_list_get_list (image, NULL,
+ gimp_image_item_list_get_list (image,
GIMP_ITEM_TYPE_LAYERS |
GIMP_ITEM_TYPE_VECTORS,
GIMP_ITEM_SET_LINKED);
edit_select->live_items =
- gimp_image_item_list_filter (NULL, edit_select->live_items);
+ gimp_image_item_list_filter (edit_select->live_items);
edit_select->delayed_items =
- gimp_image_item_list_get_list (image, NULL,
+ gimp_image_item_list_get_list (image,
GIMP_ITEM_TYPE_CHANNELS,
GIMP_ITEM_SET_LINKED);
edit_select->delayed_items =
- gimp_image_item_list_filter (NULL, edit_select->delayed_items);
+ gimp_image_item_list_filter (edit_select->delayed_items);
break;
default:
@@ -828,11 +826,10 @@ gimp_edit_selection_tool_draw (GimpDrawTool *draw_tool)
GList *linked;
GList *list;
- linked = gimp_image_item_list_get_list (image, NULL,
+ linked = gimp_image_item_list_get_list (image,
GIMP_ITEM_TYPE_LAYERS,
GIMP_ITEM_SET_LINKED);
-
- linked = gimp_image_item_list_filter (NULL, linked);
+ linked = gimp_image_item_list_filter (linked);
for (list = linked; list; list = g_list_next (list))
{
@@ -873,11 +870,10 @@ gimp_edit_selection_tool_draw (GimpDrawTool *draw_tool)
GList *linked;
GList *list;
- linked = gimp_image_item_list_get_list (image, NULL,
+ linked = gimp_image_item_list_get_list (image,
GIMP_ITEM_TYPE_VECTORS,
GIMP_ITEM_SET_LINKED);
-
- linked = gimp_image_item_list_filter (NULL, linked);
+ linked = gimp_image_item_list_filter (linked);
for (list = linked; list; list = g_list_next (list))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]