]> saetta.ns0.it Git - zakform/libzakform/commitdiff
Missing xml properties parsing.
authorAndrea Zagli <azagli@libero.it>
Thu, 3 Dec 2015 14:52:55 +0000 (15:52 +0100)
committerAndrea Zagli <azagli@libero.it>
Thu, 3 Dec 2015 14:52:55 +0000 (15:52 +0100)
src/formelement.c

index 05a7ec0adc13a2b5f1d5fe65e7eaca8f9955f935..9ce119fee5a5f89381f3001221f67d947b348a62 100644 (file)
@@ -170,7 +170,7 @@ zak_form_element_init (ZakFormElement *zak_form_element)
        ZakFormElementPrivate *priv = zak_form_element_get_instance_private (zak_form_element);
 
        priv->name = g_strdup ("");
-       priv->is_key = TRUE;
+       priv->is_key = FALSE;
        priv->type = g_strdup ("");
        priv->value = g_strdup ("");
        priv->visible = TRUE;
@@ -904,6 +904,10 @@ zak_form_element_xml_parsing (ZakFormElement *element, xmlNode *xmlnode)
                                {
                                        zak_form_element_set_name (element, (const gchar *)xmlNodeGetContent (cur));
                                }
+                   else if (xmlStrcmp (cur->name, (const xmlChar *)"is-key") == 0)
+                               {
+                                       zak_form_element_set_is_key (element, xmlStrEqual ((const gchar *)xmlNodeGetContent (cur), "TRUE"));
+                               }
                    else if (xmlStrcmp (cur->name, (const xmlChar *)"type") == 0)
                                {
                                        zak_form_element_set_provider_type (element, (const gchar *)xmlNodeGetContent (cur));
@@ -912,6 +916,22 @@ zak_form_element_xml_parsing (ZakFormElement *element, xmlNode *xmlnode)
                                {
                                        zak_form_element_set_default_value (element, (const gchar *)xmlNodeGetContent (cur));
                                }
+                   else if (xmlStrcmp (cur->name, (const xmlChar *)"visible") == 0)
+                               {
+                                       zak_form_element_set_visible (element, xmlStrEqual ((const gchar *)xmlNodeGetContent (cur), "TRUE"));
+                               }
+                   else if (xmlStrcmp (cur->name, (const xmlChar *)"editable") == 0)
+                               {
+                                       zak_form_element_set_editable (element, xmlStrEqual ((const gchar *)xmlNodeGetContent (cur), "TRUE"));
+                               }
+                   else if (xmlStrcmp (cur->name, (const xmlChar *)"to-load") == 0)
+                               {
+                                       zak_form_element_set_to_load (element, xmlStrEqual ((const gchar *)xmlNodeGetContent (cur), "TRUE"));
+                               }
+                   else if (xmlStrcmp (cur->name, (const xmlChar *)"to-save") == 0)
+                               {
+                                       zak_form_element_set_to_save (element, xmlStrEqual ((const gchar *)xmlNodeGetContent (cur), "TRUE"));
+                               }
 
                        cur = cur->next;
                }