[glade/headerbar] Added return if fail warning



commit bbd412341c469b1c2ec9890ffe3908fb69ba5cc8
Author: Tristan Van Berkom <tristan upstairslabs com>
Date:   Fri Nov 7 17:12:07 2014 +0900

    Added return if fail warning
    
    In glade_gtk_container_replace_child(), warn if the passed 'current' widget
    is not a direct child of 'container'.

 plugins/gtk+/glade-gtk-container.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/plugins/gtk+/glade-gtk-container.c b/plugins/gtk+/glade-gtk-container.c
index 6064ea7..0c92e83 100644
--- a/plugins/gtk+/glade-gtk-container.c
+++ b/plugins/gtk+/glade-gtk-container.c
@@ -97,8 +97,7 @@ glade_gtk_container_replace_child (GladeWidgetAdaptor * adaptor,
   guint nproperties;
   guint i;
 
-  if (gtk_widget_get_parent (current) != container)
-    return;
+  g_return_if_fail (gtk_widget_get_parent (current) == container);
 
   param_spec = gtk_container_class_list_child_properties
       (G_OBJECT_GET_CLASS (container), &nproperties);


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