libgimpwidgets, modules: improve set_color_config() functions a bit
Don't do anything if the config doesn't change.
This commit is contained in:
@ -614,6 +614,8 @@ gimp_color_area_set_color_config (GimpColorArea *area,
|
||||
|
||||
priv = GET_PRIVATE (area);
|
||||
|
||||
if (config != priv->config)
|
||||
{
|
||||
if (priv->config)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (priv->config,
|
||||
@ -638,6 +640,7 @@ gimp_color_area_set_color_config (GimpColorArea *area,
|
||||
G_CALLBACK (gimp_color_area_config_notify),
|
||||
area);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -660,6 +660,8 @@ gimp_color_scale_set_color_config (GimpColorScale *scale,
|
||||
|
||||
priv = GET_PRIVATE (scale);
|
||||
|
||||
if (config != priv->config)
|
||||
{
|
||||
if (priv->config)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (priv->config,
|
||||
@ -684,6 +686,7 @@ gimp_color_scale_set_color_config (GimpColorScale *scale,
|
||||
G_CALLBACK (gimp_color_scale_config_notify),
|
||||
scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1799,6 +1799,8 @@ gimp_preview_area_set_color_config (GimpPreviewArea *area,
|
||||
|
||||
priv = GET_PRIVATE (area);
|
||||
|
||||
if (config != priv->config)
|
||||
{
|
||||
if (priv->config)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (priv->config,
|
||||
@ -1823,6 +1825,7 @@ gimp_preview_area_set_color_config (GimpPreviewArea *area,
|
||||
G_CALLBACK (gimp_preview_area_config_notify),
|
||||
area);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -268,13 +268,12 @@ colorsel_cmyk_set_config (GimpColorSelector *selector,
|
||||
{
|
||||
ColorselCmyk *module = COLORSEL_CMYK (selector);
|
||||
|
||||
if (config == module->config)
|
||||
return;
|
||||
|
||||
if (config != module->config)
|
||||
{
|
||||
if (module->config)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (module->config,
|
||||
G_CALLBACK (colorsel_cmyk_config_changed),
|
||||
colorsel_cmyk_config_changed,
|
||||
module);
|
||||
g_object_unref (module->config);
|
||||
}
|
||||
@ -290,6 +289,7 @@ colorsel_cmyk_set_config (GimpColorSelector *selector,
|
||||
}
|
||||
|
||||
colorsel_cmyk_config_changed (module);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -230,6 +230,8 @@ colorsel_water_set_config (GimpColorSelector *selector,
|
||||
{
|
||||
ColorselWater *water = COLORSEL_WATER (selector);
|
||||
|
||||
if (config != water->config)
|
||||
{
|
||||
if (water->config)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (water->config,
|
||||
@ -254,6 +256,7 @@ colorsel_water_set_config (GimpColorSelector *selector,
|
||||
G_CALLBACK (colorsel_water_config_notify),
|
||||
water);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1462,6 +1462,8 @@ gimp_color_wheel_set_color_config (GimpColorWheel *wheel,
|
||||
|
||||
priv = wheel->priv;
|
||||
|
||||
if (config != priv->config)
|
||||
{
|
||||
if (priv->config)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (priv->config,
|
||||
@ -1486,6 +1488,7 @@ gimp_color_wheel_set_color_config (GimpColorWheel *wheel,
|
||||
G_CALLBACK (gimp_color_wheel_config_notify),
|
||||
wheel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user