From d03752cdcc835241053fad416f41073783d027ac Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 9 Jun 2014 09:41:09 -0400 Subject: [PATCH] GtkSpinButton: Use G_PARAM_EXPLICIT_NOTIFY --- gtk/gtkspinbutton.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index 26b0d147f8..38dd76b0db 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -353,20 +353,16 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class) g_param_spec_double ("climb-rate", P_("Climb Rate"), P_("The acceleration rate when you hold down a button"), - 0.0, - G_MAXDOUBLE, - 0.0, - GTK_PARAM_READWRITE)); + 0.0, G_MAXDOUBLE, 0.0, + GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY)); g_object_class_install_property (gobject_class, PROP_DIGITS, g_param_spec_uint ("digits", P_("Digits"), P_("The number of decimal places to display"), - 0, - MAX_DIGITS, - 0, - GTK_PARAM_READWRITE)); + 0, MAX_DIGITS, 0, + GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY)); g_object_class_install_property (gobject_class, PROP_SNAP_TO_TICKS, @@ -374,7 +370,7 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class) P_("Snap to Ticks"), P_("Whether erroneous values are automatically changed to a spin button's nearest step increment"), FALSE, - GTK_PARAM_READWRITE)); + GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY)); g_object_class_install_property (gobject_class, PROP_NUMERIC, @@ -382,7 +378,7 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class) P_("Numeric"), P_("Whether non-numeric characters should be ignored"), FALSE, - GTK_PARAM_READWRITE)); + GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY)); g_object_class_install_property (gobject_class, PROP_WRAP, @@ -390,7 +386,7 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class) P_("Wrap"), P_("Whether a spin button should wrap upon reaching its limits"), FALSE, - GTK_PARAM_READWRITE)); + GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY)); g_object_class_install_property (gobject_class, PROP_UPDATE_POLICY, @@ -399,17 +395,15 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class) P_("Whether the spin button should update always, or only when the value is legal"), GTK_TYPE_SPIN_BUTTON_UPDATE_POLICY, GTK_UPDATE_ALWAYS, - GTK_PARAM_READWRITE)); + GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY)); g_object_class_install_property (gobject_class, PROP_VALUE, g_param_spec_double ("value", P_("Value"), P_("Reads the current value, or sets a new value"), - -G_MAXDOUBLE, - G_MAXDOUBLE, - 0.0, - GTK_PARAM_READWRITE)); + -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, + GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY)); g_object_class_override_property (gobject_class, PROP_ORIENTATION, @@ -2489,7 +2483,7 @@ gtk_spin_button_set_value (GtkSpinButton *spin_button, { gint return_val = FALSE; g_signal_emit (spin_button, spinbutton_signals[OUTPUT], 0, &return_val); - if (return_val == FALSE) + if (!return_val) gtk_spin_button_default_output (spin_button); } }