plug-ins: remove undo_group parameter from lcms_image_set_profile()
and simply always push an undo group, there is no harm or overhead in nested undo groups.
This commit is contained in:
@ -111,8 +111,7 @@ static cmsHPROFILE lcms_image_get_profile (GimpColorConfig *config,
|
||||
GError **error);
|
||||
static gboolean lcms_image_set_profile (gint32 image,
|
||||
cmsHPROFILE profile,
|
||||
const gchar *filename,
|
||||
gboolean undo_group);
|
||||
const gchar *filename);
|
||||
static gboolean lcms_image_apply_profile (gint32 image,
|
||||
cmsHPROFILE src_profile,
|
||||
cmsHPROFILE dest_profile,
|
||||
@ -511,7 +510,7 @@ lcms_icc_set (GimpColorConfig *config,
|
||||
if (! filename)
|
||||
filename = config->rgb_profile;
|
||||
|
||||
success = lcms_image_set_profile (image, NULL, filename, TRUE);
|
||||
success = lcms_image_set_profile (image, NULL, filename);
|
||||
|
||||
return success ? GIMP_PDB_SUCCESS : GIMP_PDB_EXECUTION_ERROR;
|
||||
}
|
||||
@ -713,8 +712,7 @@ lcms_image_get_profile (GimpColorConfig *config,
|
||||
static gboolean
|
||||
lcms_image_set_profile (gint32 image,
|
||||
cmsHPROFILE profile,
|
||||
const gchar *filename,
|
||||
gboolean undo_group)
|
||||
const gchar *filename)
|
||||
{
|
||||
g_return_val_if_fail (image != -1, FALSE);
|
||||
|
||||
@ -752,8 +750,7 @@ lcms_image_set_profile (gint32 image,
|
||||
}
|
||||
}
|
||||
|
||||
if (undo_group)
|
||||
gimp_image_undo_group_start (image);
|
||||
gimp_image_undo_group_start (image);
|
||||
|
||||
parasite = gimp_parasite_new ("icc-profile",
|
||||
GIMP_PARASITE_PERSISTENT |
|
||||
@ -768,16 +765,14 @@ lcms_image_set_profile (gint32 image,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (undo_group)
|
||||
gimp_image_undo_group_start (image);
|
||||
gimp_image_undo_group_start (image);
|
||||
|
||||
gimp_image_detach_parasite (image, "icc-profile");
|
||||
}
|
||||
|
||||
gimp_image_detach_parasite (image, "icc-profile-name");
|
||||
|
||||
if (undo_group)
|
||||
gimp_image_undo_group_end (image);
|
||||
gimp_image_undo_group_end (image);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -796,7 +791,7 @@ lcms_image_apply_profile (gint32 image,
|
||||
|
||||
gimp_image_undo_group_start (image);
|
||||
|
||||
if (! lcms_image_set_profile (image, dest_profile, filename, FALSE))
|
||||
if (! lcms_image_set_profile (image, dest_profile, filename))
|
||||
{
|
||||
gimp_image_undo_group_end (image);
|
||||
|
||||
@ -1494,7 +1489,7 @@ lcms_dialog (GimpColorConfig *config,
|
||||
values->bpc);
|
||||
else
|
||||
success = lcms_image_set_profile (image,
|
||||
dest_profile, filename, TRUE);
|
||||
dest_profile, filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user