core: Update XCF version even if layer effects are inactive

Similar to afc0a6d1, we need to use gimp_drawable_get_filters () to
get the total number of filters rather than gimp_drawable_has_filters (),
which just returns if any filters in the stack are active/visible.
Because of this, we weren't updating the XCF version to 22 when we
saved a file that had all of its layer effects set to invisible/inactive.
This commit is contained in:
Alx Sa
2024-10-16 13:32:56 +00:00
parent e5f217b3d0
commit c19f6509ea

View File

@ -2783,7 +2783,8 @@ gimp_image_get_xcf_version (GimpImage *image,
items = gimp_image_get_layer_list (image);
for (list = items; list; list = g_list_next (list))
{
GimpLayer *layer = GIMP_LAYER (list->data);
GimpLayer *layer = GIMP_LAYER (list->data);
GimpContainer *filters;
switch (gimp_layer_get_mode (layer))
{
@ -2934,7 +2935,8 @@ gimp_image_get_xcf_version (GimpImage *image,
version = MAX (19, version);
}
if (gimp_drawable_has_filters (GIMP_DRAWABLE (layer)))
filters = gimp_drawable_get_filters (GIMP_DRAWABLE (layer));
if (gimp_container_get_n_children (filters) > 0)
{
ADD_REASON (g_strdup_printf (_("Layer effects were added in %s"),
"GIMP 3.0"));