[gegl] Remove "babl-tolerance" from GeglConfig



commit ca05b2e2e9046202dbc167187036a7aba61ab48c
Author: Daniel Sabo <DanielSabo gmail com>
Date:   Wed Mar 5 05:06:03 2014 -0800

    Remove "babl-tolerance" from GeglConfig
    
    Because of the way babl parses this variable from the environment
    the config value never really worked as expected. Since it is
    causing some unrelated issues with printf and locale I am electing
    to just drop the setting. It can still be modified by setting the
    environment variable before calling init if you really know what
    you're doing.

 gegl/gegl-config.c |   42 ------------------------------------------
 gegl/gegl-config.h |    1 -
 gegl/gegl-init.c   |    9 ---------
 3 files changed, 0 insertions(+), 52 deletions(-)
---
diff --git a/gegl/gegl-config.c b/gegl/gegl-config.c
index 7308b56..f922575 100644
--- a/gegl/gegl-config.c
+++ b/gegl/gegl-config.c
@@ -40,7 +40,6 @@ enum
   PROP_TILE_CACHE_SIZE,
   PROP_CHUNK_SIZE,
   PROP_SWAP,
-  PROP_BABL_TOLERANCE,
   PROP_TILE_WIDTH,
   PROP_TILE_HEIGHT,
   PROP_THREADS,
@@ -79,10 +78,6 @@ gegl_config_get_property (GObject    *gobject,
         g_value_set_double (value, config->quality);
         break;
 
-      case PROP_BABL_TOLERANCE:
-        g_value_set_double (value, config->babl_tolerance);
-        break;
-
       case PROP_SWAP:
         g_value_set_string (value, config->swap);
         break;
@@ -134,35 +129,6 @@ gegl_config_set_property (GObject      *gobject,
       case PROP_QUALITY:
         config->quality = g_value_get_double (value);
         return;
-      case PROP_BABL_TOLERANCE:
-          {
-            /* XXX: this only works the first time, and since it is a
-             * construct property the values overriden from gimp does not take
-             * effect
-             */
-            static gboolean first = TRUE;
-            static gboolean overridden = FALSE;
-
-            gchar buf[256];
-
-            if (first)
-              {
-                if (g_getenv ("BABL_TOLERANCE") != NULL)
-                  overridden = TRUE;
-                first = FALSE;
-              }
-            if (!overridden)
-              {
-                config->babl_tolerance = g_value_get_double (value);
-                g_sprintf (buf, "%f", config->babl_tolerance);
-                g_setenv ("BABL_TOLERANCE", buf, 0);
-                /* babl picks up the babl error through the environment, babl
-                 * caches valid conversions though so this needs to be set
-                 * before _any_ processing is done
-                 */
-              }
-          }
-        return;
       case PROP_SWAP:
         if (config->swap)
           g_free (config->swap);
@@ -251,14 +217,6 @@ gegl_config_class_init (GeglConfigClass *klass)
                                                         G_PARAM_READWRITE |
                                                         G_PARAM_CONSTRUCT));
 
-  g_object_class_install_property (gobject_class, PROP_BABL_TOLERANCE,
-                                   g_param_spec_double ("babl-tolerance",
-                                                        "babl error",
-                                                        "the error tolerance babl operates with",
-                                                        0.0, 0.2, 0.000001,
-                                                        G_PARAM_READWRITE |
-                                                        G_PARAM_CONSTRUCT));
-
   g_object_class_install_property (gobject_class, PROP_SWAP,
                                    g_param_spec_string ("swap",
                                                         "Swap",
diff --git a/gegl/gegl-config.h b/gegl/gegl-config.h
index 3faec93..607c883 100644
--- a/gegl/gegl-config.h
+++ b/gegl/gegl-config.h
@@ -39,7 +39,6 @@ struct _GeglConfig
   guint64  tile_cache_size;
   gint     chunk_size; /* The size of elements being processed at once */
   gdouble  quality;
-  gdouble  babl_tolerance;
   gint     tile_width;
   gint     tile_height;
   gint     threads;
diff --git a/gegl/gegl-init.c b/gegl/gegl-init.c
index ef6e89b..3fc3fb8 100644
--- a/gegl/gegl-init.c
+++ b/gegl/gegl-init.c
@@ -251,18 +251,12 @@ static gchar    *cmd_gegl_cache_size     = NULL;
 static gchar    *cmd_gegl_chunk_size     = NULL;
 static gchar    *cmd_gegl_quality        = NULL;
 static gchar    *cmd_gegl_tile_size      = NULL;
-static gchar    *cmd_babl_tolerance      = NULL;
 static gchar    *cmd_gegl_threads        = NULL;
 static gboolean *cmd_gegl_disable_opencl = NULL;
 
 static const GOptionEntry cmd_entries[]=
 {
     {
-     "babl-tolerance", 0, 0,
-     G_OPTION_ARG_STRING, &cmd_babl_tolerance,
-     N_("babls error tolerance, a value between 0.2 and 0.000000001"), "<float>"
-    },
-    {
      "gegl-swap", 0, 0,
      G_OPTION_ARG_STRING, &cmd_gegl_swap,
      N_("Where GEGL stores its swap"), "<uri>"
@@ -609,9 +603,6 @@ gegl_post_parse_hook (GOptionContext *context,
     }
   if (cmd_gegl_threads)
     config->threads = atoi (cmd_gegl_threads);
-  /* FIXME: This comes after babl init and is useless */
-  if (cmd_babl_tolerance)
-    g_object_set (config, "babl-tolerance", atof(cmd_babl_tolerance), NULL);
   if (cmd_gegl_disable_opencl)
     gegl_cl_hard_disable ();
 


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