]> saetta.ns0.it Git - libgtkform/commitdiff
Bugfixes.
authorAndrea Zagli <azagli@libero.it>
Wed, 2 Sep 2009 16:21:45 +0000 (18:21 +0200)
committerAndrea Zagli <azagli@libero.it>
Wed, 2 Sep 2009 16:21:45 +0000 (18:21 +0200)
src/form.c

index 646e057900bafe124dcc5f0ca0bc24153b0b37a3..962ef2479c834fc0552e21acbe4a43ba436500dd 100644 (file)
@@ -213,6 +213,8 @@ GtkForm
                                                                }
                                                        else if (xmlStrcmp (cur->name, (const xmlChar *)"widget") == 0)
                                                                {
+                                                                       widget = NULL;
+
                                                                        type = xmlGetProp (cur, (const xmlChar *)"type");
                                                                        if (strcmp (type, "checkbox") == 0)
                                                                                {
@@ -274,6 +276,8 @@ GtkForm
                                                                                                                }
                                                                                                        else if (xmlStrcmp (node_widget->name, (const xmlChar *)"field") == 0)
                                                                                                                {
+                                                                                                                       field = NULL;
+
                                                                                                                        type = xmlGetProp (node_widget, (const xmlChar *)"type");
                                                                                                                        if (strcmp (type, "boolean") == 0)
                                                                                                                                {
@@ -377,11 +381,19 @@ GtkForm
                                                                                                                                                        node_field = node_field->next;
                                                                                                                                                }
                                                                                                                                }
+                                                                                                                       else
+                                                                                                                               {
+                                                                                                                                       g_warning ("Field of type «%s» not found.", type);
+                                                                                                                               }
                                                                                                                } 
 
                                                                                                        node_widget = node_widget->next;
                                                                                                }
                                                                                }
+                                                                       else
+                                                                               {
+                                                                                       g_warning ("Widget of type «%s» not found.", type);
+                                                                               }
                                                                }
 
                                                        cur = cur->next;
@@ -970,13 +982,13 @@ gtk_form_set_sensitive_by_name (GtkForm *form, gboolean sensitive, ...)
 
        GObject *object;
 
-       g_return_val_if_fail (IS_GTK_FORM (form), NULL);
+       g_return_if_fail (IS_GTK_FORM (form));
 
        priv = GTK_FORM_GET_PRIVATE (form);
 
-       g_return_val_if_fail (GTK_IS_BUILDER (priv->gtkbuilder), NULL);
+       g_return_if_fail (GTK_IS_BUILDER (priv->gtkbuilder));
 
-       va_start (vargs, form);
+       va_start (vargs, sensitive);
 
        while ((object_name = va_arg (vargs, gchar *)) != NULL)
                {