[gimp] app: simply pass through from the COMMIT to HALT action.



commit fa53be1a57af6ee9ac3fd35470b9e6282eb3597a
Author: Jehan <jehan girinstud io>
Date:   Sun Feb 11 02:02:15 2018 +0100

    app: simply pass through from the COMMIT to HALT action.
    
    Improving previous commit. Rather than calling:
    > GIMP_TOOL_GET_CLASS (tool)->control (tool,
                                           GIMP_TOOL_ACTION_HALT,
                                           display)
    > gimp_tool_clear_status()
    ... in the COMMIT action, which is basically what the HALT action does,
    simply pass through from one case to the other. It also adds the call to
    gimp_tool_control_halt() which is most likely right anyway since we are
    halting the tool. This also makes the code consistent and any future
    changes to HALT case will be directly enabled after COMMIT.

 app/tools/gimptool.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/app/tools/gimptool.c b/app/tools/gimptool.c
index aadd629..1a59913 100644
--- a/app/tools/gimptool.c
+++ b/app/tools/gimptool.c
@@ -672,23 +672,22 @@ gimp_tool_control (GimpTool       *tool,
         }
       break;
 
-    case GIMP_TOOL_ACTION_HALT:
+    case GIMP_TOOL_ACTION_COMMIT:
       GIMP_TOOL_GET_CLASS (tool)->control (tool, action, display);
 
-      if (gimp_tool_control_is_active (tool->control))
-        gimp_tool_control_halt (tool->control);
-
-      gimp_tool_clear_status (tool);
-      break;
-
-    case GIMP_TOOL_ACTION_COMMIT:
       /*  always HALT after COMMIT here and not in each tool individually;
        *  some tools interact with their subclasses (e.g. filter tool
        *  and operation tool), and it's essential that COMMIT runs
        *  through the entire class hierarchy before HALT
        */
+      action = GIMP_TOOL_ACTION_HALT;
+
+      /* pass through */
+    case GIMP_TOOL_ACTION_HALT:
       GIMP_TOOL_GET_CLASS (tool)->control (tool, action, display);
-      GIMP_TOOL_GET_CLASS (tool)->control (tool, GIMP_TOOL_ACTION_HALT, display);
+
+      if (gimp_tool_control_is_active (tool->control))
+        gimp_tool_control_halt (tool->control);
 
       gimp_tool_clear_status (tool);
       break;


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