[gimp] plug-ins: remove undo_group parameter from lcms_image_set_profile()



commit 18c0ab0a196d69173d63a2fee0299d221dba5b3e
Author: Michael Natterer <mitch gimp org>
Date:   Sat Mar 29 14:54:41 2014 +0100

    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.

 plug-ins/common/lcms.c |   21 ++++++++-------------
 1 files changed, 8 insertions(+), 13 deletions(-)
---
diff --git a/plug-ins/common/lcms.c b/plug-ins/common/lcms.c
index ed4fc4e..3475f8f 100644
--- a/plug-ins/common/lcms.c
+++ b/plug-ins/common/lcms.c
@@ -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
             {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]