[gimp] app: use gimp_gegl_node_get_key() in GimpFilterTool



commit 10a528ed2f53004c90e2b9a4a97e4bb25be0d31b
Author: Ell <ell_se yahoo com>
Date:   Fri Jan 17 16:42:40 2020 +0200

    app: use gimp_gegl_node_get_key() in GimpFilterTool
    
    ... instead of doing the same thing manually.  This was supposed
    to be part of the previous commits.

 app/tools/gimpfiltertool.c | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)
---
diff --git a/app/tools/gimpfiltertool.c b/app/tools/gimpfiltertool.c
index 326603b2f3..12b70f55fd 100644
--- a/app/tools/gimpfiltertool.c
+++ b/app/tools/gimpfiltertool.c
@@ -1111,11 +1111,6 @@ gimp_filter_tool_update_dialog (GimpFilterTool *filter_tool)
     {
       GimpImage   *image = gimp_display_get_image (tool->display);
       GimpChannel *mask  = gimp_image_get_mask (image);
-      gchar       *operation_name;
-
-      gegl_node_get (filter_tool->operation,
-                     "operation", &operation_name,
-                     NULL);
 
       if (gimp_channel_is_empty (mask))
         {
@@ -1134,11 +1129,9 @@ gimp_filter_tool_update_dialog (GimpFilterTool *filter_tool)
           gtk_widget_set_visible (
             filter_tool->region_combo,
             ! gimp_gegl_node_is_point_operation (filter_tool->operation) ||
-            (operation_name                                              &&
-             gegl_operation_get_key (operation_name, "position-dependent")));
+            gimp_gegl_node_get_key (filter_tool->operation,
+                                    "position-dependent"));
         }
-
-      g_free (operation_name);
     }
 }
 
@@ -1384,18 +1377,14 @@ gimp_filter_tool_update_filter (GimpFilterTool *filter_tool)
 {
   GimpTool          *tool    = GIMP_TOOL (filter_tool);
   GimpFilterOptions *options = GIMP_FILTER_TOOL_GET_OPTIONS (filter_tool);
-  const gchar       *operation_name;
   gboolean           add_alpha;
   gboolean           clip;
 
   if (! filter_tool->filter)
     return;
 
-  operation_name = gegl_node_get_operation (filter_tool->operation);
-
   add_alpha = gimp_drawable_supports_alpha (tool->drawable) &&
-              operation_name                                &&
-              gegl_operation_get_key (operation_name, "needs-alpha");
+              gimp_gegl_node_get_key (filter_tool->operation, "needs-alpha");
   clip      = options->clip == GIMP_TRANSFORM_RESIZE_CLIP ||
               ! (gimp_drawable_has_alpha (tool->drawable) ||
                  add_alpha);
@@ -1563,7 +1552,7 @@ gimp_filter_tool_get_operation (GimpFilterTool *filter_tool)
     }
 
   if (gimp_gegl_node_is_point_operation (filter_tool->operation) &&
-      ! gegl_operation_get_key (operation_name, "position-dependent"))
+      ! gimp_gegl_node_get_key (filter_tool->operation, "position-dependent"))
     {
       g_object_set (GIMP_FILTER_TOOL_GET_OPTIONS (filter_tool),
                     "region", GIMP_FILTER_REGION_SELECTION,


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