From: Andrea Zagli Date: Thu, 3 Dec 2015 14:52:55 +0000 (+0100) Subject: Missing xml properties parsing. X-Git-Tag: debian/0.0.1-1~25 X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=e078f7504a7957cd51ac37c3fa883eea7c478950;p=zakform%2Flibzakform Missing xml properties parsing. --- diff --git a/src/formelement.c b/src/formelement.c index 05a7ec0..9ce119f 100644 --- a/src/formelement.c +++ b/src/formelement.c @@ -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; }