[gtk+] stack: Use g_object_notify_by_pspec()



commit 468fd385310547ccce738da2cdb97be5a8c911ae
Author: David King <dking redhat com>
Date:   Tue Nov 5 10:18:37 2013 +0000

    stack: Use g_object_notify_by_pspec()
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711611

 gtk/gtkstack.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index 4ff4d59..830b3c6 100644
--- a/gtk/gtkstack.c
+++ b/gtk/gtkstack.c
@@ -624,7 +624,8 @@ gtk_stack_set_child_property (GtkContainer *container,
       gtk_container_child_notify (container, child, "name");
 
       if (priv->visible_child == info)
-        g_object_notify (G_OBJECT (stack), "visible-child-name");
+        g_object_notify_by_pspec (G_OBJECT (stack),
+                                  stack_props[PROP_VISIBLE_CHILD_NAME]);
 
       break;
 
@@ -955,8 +956,9 @@ set_visible_child (GtkStack               *stack,
   gtk_widget_queue_resize (GTK_WIDGET (stack));
   gtk_widget_queue_draw (GTK_WIDGET (stack));
 
-  g_object_notify (G_OBJECT (stack), "visible-child");
-  g_object_notify (G_OBJECT (stack), "visible-child-name");
+  g_object_notify_by_pspec (G_OBJECT (stack), stack_props[PROP_VISIBLE_CHILD]);
+  g_object_notify_by_pspec (G_OBJECT (stack),
+                            stack_props[PROP_VISIBLE_CHILD_NAME]);
 
   gtk_stack_start_transition (stack, transition_type, transition_duration);
 }
@@ -1149,7 +1151,7 @@ gtk_stack_set_homogeneous (GtkStack *stack,
   if (gtk_widget_get_visible (GTK_WIDGET(stack)))
     gtk_widget_queue_resize (GTK_WIDGET (stack));
 
-  g_object_notify (G_OBJECT (stack), "homogeneous");
+  g_object_notify_by_pspec (G_OBJECT (stack), stack_props[PROP_HOMOGENEOUS]);
 }
 
 /**
@@ -1213,7 +1215,8 @@ gtk_stack_set_transition_duration (GtkStack *stack,
   g_return_if_fail (GTK_IS_STACK (stack));
 
   priv->transition_duration = duration;
-  g_object_notify (G_OBJECT (stack), "transition-duration");
+  g_object_notify_by_pspec (G_OBJECT (stack),
+                            stack_props[PROP_TRANSITION_DURATION]);
 }
 
 /**
@@ -1261,7 +1264,8 @@ gtk_stack_set_transition_type (GtkStack              *stack,
   g_return_if_fail (GTK_IS_STACK (stack));
 
   priv->transition_type = transition;
-  g_object_notify (G_OBJECT (stack), "transition-type");
+  g_object_notify_by_pspec (G_OBJECT (stack),
+                            stack_props[PROP_TRANSITION_TYPE]);
 }
 
 /**


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