From da559c08f93d6832f4b9d3199cf5a22ac7f035f9 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 16 Feb 2015 16:58:17 +0100 Subject: [PATCH] switch: Have a priv varibale in the constructor --- gtk/gtkswitch.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gtk/gtkswitch.c b/gtk/gtkswitch.c index d3a9a067ba..1f5692c8bc 100644 --- a/gtk/gtkswitch.c +++ b/gtk/gtkswitch.c @@ -992,11 +992,13 @@ gtk_switch_class_init (GtkSwitchClass *klass) static void gtk_switch_init (GtkSwitch *self) { + GtkSwitchPrivate *priv; GtkStyleContext *context; GtkGesture *gesture; - self->priv = gtk_switch_get_instance_private (self); - self->priv->use_action_appearance = TRUE; + priv = self->priv = gtk_switch_get_instance_private (self); + + priv->use_action_appearance = TRUE; gtk_widget_set_has_window (GTK_WIDGET (self), FALSE); gtk_widget_set_can_focus (GTK_WIDGET (self), TRUE); @@ -1009,7 +1011,7 @@ gtk_switch_init (GtkSwitch *self) G_CALLBACK (gtk_switch_multipress_gesture_released), self); gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), GTK_PHASE_BUBBLE); - self->priv->multipress_gesture = gesture; + priv->multipress_gesture = gesture; gesture = gtk_gesture_pan_new (GTK_WIDGET (self), GTK_ORIENTATION_HORIZONTAL); @@ -1021,7 +1023,7 @@ gtk_switch_init (GtkSwitch *self) G_CALLBACK (gtk_switch_pan_gesture_drag_end), self); gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), GTK_PHASE_BUBBLE); - self->priv->pan_gesture = gesture; + priv->pan_gesture = gesture; context = gtk_widget_get_style_context (GTK_WIDGET (self)); gtk_style_context_add_class (context, GTK_STYLE_CLASS_TROUGH);