[gimp/soc-2011-seamless-clone2] Bug 693797 - Sample colorize fails when you choose current gradient as target
- From: Clayton Walker <claytonw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/soc-2011-seamless-clone2] Bug 693797 - Sample colorize fails when you choose current gradient as target
- Date: Wed, 8 May 2013 15:01:04 +0000 (UTC)
commit 130bc2b66359163f9af8cde48c36ea86c7920a91
Author: Michael Natterer <mitch gimp org>
Date: Sun Feb 17 01:45:20 2013 +0100
Bug 693797 - Sample colorize fails when you choose current gradient as target
Fix my last commit and don't delete items in the foreach() callback,
because it's impossible to delete items in foreach(). Instead, collect
them in a list and remove them after foreach().
libgimp/gimpitemcombobox.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/libgimp/gimpitemcombobox.c b/libgimp/gimpitemcombobox.c
index 7ed47d0..0e85256 100644
--- a/libgimp/gimpitemcombobox.c
+++ b/libgimp/gimpitemcombobox.c
@@ -543,14 +543,15 @@ gimp_item_combo_box_remove_items (GtkTreeModel *model,
GtkTreeIter *iter,
gpointer data)
{
- gint item_ID;
+ gint item_ID;
+ GList **remove = data;
gtk_tree_model_get (model, iter,
GIMP_INT_STORE_VALUE, &item_ID,
-1);
if (item_ID > 0)
- gtk_list_store_remove (GTK_LIST_STORE (model), iter);
+ *remove = g_list_prepend (*remove, g_memdup (iter, sizeof (GtkTreeIter)));
return FALSE;
}
@@ -565,6 +566,8 @@ gimp_item_combo_box_changed (GimpIntComboBox *combo_box)
if (item_ID > 0 && ! gimp_item_is_valid (item_ID))
{
GtkTreeModel *model;
+ GList *remove = NULL;
+ GList *list;
model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo_box));
@@ -572,7 +575,13 @@ gimp_item_combo_box_changed (GimpIntComboBox *combo_box)
gtk_tree_model_foreach (model,
gimp_item_combo_box_remove_items,
- NULL);
+ &remove);
+
+ for (list = remove; list; list = g_list_next (list))
+ gtk_list_store_remove (GTK_LIST_STORE (model), list->data);
+
+ g_list_free_full (remove, (GDestroyNotify) g_free);
+
gimp_item_combo_box_populate (combo_box);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]