GtkCellRendererSpinner: Use G_PARAM_EXPLICIT_NOTIFY

This commit is contained in:
Matthias Clasen 2014-06-07 11:47:30 -04:00
parent f4e60bc36d
commit 5e04bd04c8

View File

@ -125,7 +125,8 @@ gtk_cell_renderer_spinner_class_init (GtkCellRendererSpinnerClass *klass)
P_("Active"), P_("Active"),
P_("Whether the spinner is active (ie. shown) in the cell"), P_("Whether the spinner is active (ie. shown) in the cell"),
FALSE, FALSE,
G_PARAM_READWRITE)); G_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
/** /**
* GtkCellRendererSpinner:pulse: * GtkCellRendererSpinner:pulse:
* *
@ -143,7 +144,8 @@ gtk_cell_renderer_spinner_class_init (GtkCellRendererSpinnerClass *klass)
P_("Pulse"), P_("Pulse"),
P_("Pulse of the spinner"), P_("Pulse of the spinner"),
0, G_MAXUINT, 0, 0, G_MAXUINT, 0,
G_PARAM_READWRITE)); G_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
/** /**
* GtkCellRendererSpinner:size: * GtkCellRendererSpinner:size:
* *
@ -157,7 +159,7 @@ gtk_cell_renderer_spinner_class_init (GtkCellRendererSpinnerClass *klass)
P_("Size"), P_("Size"),
P_("The GtkIconSize value that specifies the size of the rendered spinner"), P_("The GtkIconSize value that specifies the size of the rendered spinner"),
GTK_TYPE_ICON_SIZE, GTK_ICON_SIZE_MENU, GTK_TYPE_ICON_SIZE, GTK_ICON_SIZE_MENU,
G_PARAM_READWRITE)); G_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
} }
@ -239,14 +241,26 @@ gtk_cell_renderer_spinner_set_property (GObject *object,
switch (param_id) switch (param_id)
{ {
case PROP_ACTIVE: case PROP_ACTIVE:
priv->active = g_value_get_boolean (value); if (priv->active != g_value_get_boolean (value))
{
priv->active = g_value_get_boolean (value);
g_object_notify (object, "active");
}
break; break;
case PROP_PULSE: case PROP_PULSE:
priv->pulse = g_value_get_uint (value); if (priv->pulse != g_value_get_uint (value))
{
priv->pulse = g_value_get_uint (value);
g_object_notify (object, "pulse");
}
break; break;
case PROP_SIZE: case PROP_SIZE:
priv->old_icon_size = priv->icon_size; if (priv->icon_size != g_value_get_enum (value))
priv->icon_size = g_value_get_enum (value); {
priv->old_icon_size = priv->icon_size;
priv->icon_size = g_value_get_enum (value);
g_object_notify (object, "size");
}
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);