Exemplo n.º 1
0
void 
set_KDE_config_group_item( xml_elem_t *group, const char *item_name, const char *value )
{
	if( group != NULL &&  group->tag_id == KDEConfig_group ) 
	{	
		char *key  = make_xml_name_key( item_name );
		if( key ) 
		{	
			xml_elem_t *item = find_KDE_config_item_by_key(group, key, True);			   
			set_KDE_config_item_value( item, value );   			   
			free( key );
		}
	}
}
Exemplo n.º 2
0
void merge_KDE_config_groups (xml_elem_t * from, xml_elem_t * to)
{

	if (from != NULL && to != NULL && from != to) {
		xml_elem_t *src_child = from->child;

		while (src_child) {
			if (src_child->tag_id == KDEConfig_item && src_child->parm) {
				xml_elem_t *dst_child;
				char *val = NULL;

				dst_child =
						find_KDE_config_item_by_key (to, src_child->parm, True);
				if (src_child->child && src_child->child->tag_id == XML_CDATA_ID)
					val = src_child->child->parm;
				set_KDE_config_item_value (dst_child, val);
			}
			src_child = src_child->next;
		}
	}
}