[gimp] plug-ins: minor simplifications because GimpColorConfig has an API now



commit 08b19a9bbcbc5c18c9985507b24f8a4bb2b7cd82
Author: Michael Natterer <mitch gimp org>
Date:   Tue May 26 08:09:29 2015 +0200

    plug-ins: minor simplifications because GimpColorConfig has an API now

 plug-ins/common/lcms.c |   26 +++++++++++---------------
 1 files changed, 11 insertions(+), 15 deletions(-)
---
diff --git a/plug-ins/common/lcms.c b/plug-ins/common/lcms.c
index 56bd795..23f9fa6 100644
--- a/plug-ins/common/lcms.c
+++ b/plug-ins/common/lcms.c
@@ -707,7 +707,7 @@ lcms_image_get_profile (GimpColorConfig  *config,
 
       gimp_parasite_free (parasite);
     }
-  else if (config->rgb_profile)
+  else
     {
       profile = gimp_color_config_get_rgb_profile (config, error);
     }
@@ -1157,6 +1157,7 @@ lcms_icc_combo_box_new (GimpColorConfig *config,
   gchar       *name;
   const gchar *rgb_filename = NULL;
   cmsHPROFILE  profile      = NULL;
+  GError      *error        = NULL;
 
   dialog = gimp_color_profile_chooser_dialog_new (_("Select destination profile"));
 
@@ -1164,21 +1165,16 @@ lcms_icc_combo_box_new (GimpColorConfig *config,
   combo = gimp_color_profile_combo_box_new (dialog, history);
   g_free (history);
 
-  if (config->rgb_profile)
-    {
-      GError *error = NULL;
-
-      profile = gimp_color_config_get_rgb_profile (config, &error);
+  profile = gimp_color_config_get_rgb_profile (config, &error);
 
-      if (! profile)
-        {
-          g_message ("%s", error->message);
-          g_clear_error (&error);
-        }
-      else
-        {
-          rgb_filename = config->rgb_profile;
-        }
+  if (profile)
+    {
+      rgb_filename = config->rgb_profile;
+    }
+  else if (error)
+    {
+      g_message ("%s", error->message);
+      g_clear_error (&error);
     }
 
   if (! profile)


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