[gtk+] switch: Have a priv varibale in the constructor



commit da559c08f93d6832f4b9d3199cf5a22ac7f035f9
Author: Benjamin Otte <otte redhat com>
Date:   Mon Feb 16 16:58:17 2015 +0100

    switch: Have a priv varibale in the constructor

 gtk/gtkswitch.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkswitch.c b/gtk/gtkswitch.c
index d3a9a06..1f5692c 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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]