diff --git a/app/tools/gimpfiltertool.c b/app/tools/gimpfiltertool.c index a9a44beea31cf035baabfa6f21197707d7b534e9..8cbf7ed7199e1d45a531565d4124bde8d40b8f9e 100644 --- a/app/tools/gimpfiltertool.c +++ b/app/tools/gimpfiltertool.c @@ -1949,11 +1949,18 @@ gimp_filter_tool_set_config (GimpFilterTool *filter_tool, mask = gimp_drawable_filter_get_mask (filter_tool->existing_filter); if (filters) { + gint existing_index; + index = gimp_container_get_child_index (filters, GIMP_OBJECT (filter_tool->existing_filter)); - gimp_container_reorder (filters, GIMP_OBJECT (filter_tool->filter), - index); + existing_index = + gimp_container_get_child_index (filters, + GIMP_OBJECT (filter_tool->filter)); + + if (existing_index > -1) + gimp_container_reorder (filters, GIMP_OBJECT (filter_tool->filter), + index); } g_object_set (filter_tool->filter, diff --git a/app/xcf/xcf-load.c b/app/xcf/xcf-load.c index 2057c329985d8ba3f36ea0de868bce1bba27a3c1..11adecdad5bd3b3a52d48e2573bbf24218e54077 100644 --- a/app/xcf/xcf-load.c +++ b/app/xcf/xcf-load.c @@ -1079,13 +1079,13 @@ xcf_load_add_effects (XcfInfo *info, { FilterData *data = iter->data; - if (! data->icon_name) - data->icon_name = g_strdup ("gimp-gegl"); - if (! data->unsupported_operation) { GimpDrawableFilter *filter = NULL; + if (! data->icon_name) + data->icon_name = g_strdup ("gimp-gegl"); + filter = gimp_drawable_filter_new (GIMP_DRAWABLE (layer), data->name, data->operation, data->icon_name); @@ -3365,15 +3365,23 @@ xcf_load_effect (XcfInfo *info, xcf_read_string (info, &string, 1); filter->operation_name = string; - if (! gegl_has_operation (filter->operation_name)) + if (! gegl_has_operation (filter->operation_name) || + ! g_strcmp0 (filter->operation_name, "gegl:nop")) { filter->unsupported_operation = TRUE; - gimp_message (info->gimp, G_OBJECT (info->progress), - GIMP_MESSAGE_WARNING, - "XCF Warning: the \"%s\" (%s) filter is " - "not installed. It was discarded.", - filter->name, filter->operation_name); + if (! g_strcmp0 (filter->operation_name, "gegl:nop")) + gimp_message (info->gimp, G_OBJECT (info->progress), + GIMP_MESSAGE_WARNING, + "XCF Warning: A filter was saved as a " + "gegl:nop. This should not happen. Please " + "report this to the developers."); + else + gimp_message (info->gimp, G_OBJECT (info->progress), + GIMP_MESSAGE_WARNING, + "XCF Warning: the \"%s\" (%s) filter is " + "not installed. It was discarded.", + filter->name, filter->operation_name); return filter; }