From a5a96a2b00634e894f5a2646a2c2d968c0bd89bb Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Mon, 31 Jul 2006 11:45:50 +0000 Subject: [PATCH] use g_type_is_a() where possible instead of checking individual tool types 2006-07-31 Michael Natterer * app/tools/gimpselectionoptions.c (gimp_selection_options_gui): use g_type_is_a() where possible instead of checking individual tool types separately. --- ChangeLog | 6 ++++++ app/tools/gimpselectionoptions.c | 12 +++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8a7e008f57..ba850fdf2b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-07-31 Michael Natterer + + * app/tools/gimpselectionoptions.c (gimp_selection_options_gui): + use g_type_is_a() where possible instead of checking individual + tool types separately. + 2006-07-31 Michael Natterer * app/tools/Makefile.am diff --git a/app/tools/gimpselectionoptions.c b/app/tools/gimpselectionoptions.c index a7be818d22..823e1dee5e 100644 --- a/app/tools/gimpselectionoptions.c +++ b/app/tools/gimpselectionoptions.c @@ -33,11 +33,9 @@ #include "widgets/gimpwidgets-utils.h" -#include "gimpbycolorselecttool.h" -#include "gimpellipseselecttool.h" #include "gimpforegroundselecttool.h" #include "gimprectangleselecttool.h" -#include "gimpfuzzyselecttool.h" +#include "gimpregionselecttool.h" #include "gimpiscissorstool.h" #include "gimpselectionoptions.h" #include "gimptooloptions-gui.h" @@ -457,8 +455,8 @@ gimp_selection_options_gui (GimpToolOptions *tool_options) } /* selection tools which operate on colors or contiguous regions */ - if (tool_options->tool_info->tool_type == GIMP_TYPE_FUZZY_SELECT_TOOL || - tool_options->tool_info->tool_type == GIMP_TYPE_BY_COLOR_SELECT_TOOL) + if (g_type_is_a (tool_options->tool_info->tool_type, + GIMP_TYPE_REGION_SELECT_TOOL)) { GtkWidget *frame; GtkWidget *vbox2; @@ -498,8 +496,8 @@ gimp_selection_options_gui (GimpToolOptions *tool_options) } /* widgets for fixed size select */ - if (tool_options->tool_info->tool_type == GIMP_TYPE_RECT_SELECT_TOOL || - tool_options->tool_info->tool_type == GIMP_TYPE_ELLIPSE_SELECT_TOOL) + if (g_type_is_a (tool_options->tool_info->tool_type, + GIMP_TYPE_RECT_SELECT_TOOL)) { GtkWidget *frame; GtkWidget *vbox2;