Signed-off-by: Nikola Pajkovsky npajkovs@redhat.com --- src/include/report/event_config.h | 1 + src/lib/event_xml_parser.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/include/report/event_config.h b/src/include/report/event_config.h index cc6c15b..12beefe 100644 --- a/src/include/report/event_config.h +++ b/src/include/report/event_config.h @@ -52,6 +52,7 @@ typedef struct char *value; char *label; option_type_t type; + int allow_empty; //char *description; //can be used as tooltip in gtk app //char *allowed_value; //int required; diff --git a/src/lib/event_xml_parser.c b/src/lib/event_xml_parser.c index 9277aea..7432913 100644 --- a/src/lib/event_xml_parser.c +++ b/src/lib/event_xml_parser.c @@ -64,7 +64,8 @@ static void consume_cur_option(struct my_parse_data *parse_data) }
event_config_t *event_config = parse_data->event_config; - GList *elem = g_list_find_custom(event_config->options, opt->name, &cmp_event_option_name_with_string); + GList *elem = g_list_find_custom(event_config->options, opt->name, + &cmp_event_option_name_with_string); if (elem) { /* we already have option with such name */ @@ -111,8 +112,7 @@ static void start_element(GMarkupParseContext *context,
event_option_t *opt = parse_data->cur_option = new_event_option();
- int i; - for (i = 0; attribute_names[i] != NULL; ++i) + for (int i = 0; attribute_names[i] != NULL; ++i) { VERB2 log("attr: %s:%s", attribute_names[i], attribute_values[i]); if (strcmp(attribute_names[i], "name") == 0) @@ -187,6 +187,13 @@ static void text(GMarkupParseContext *context, opt->value = text_copy; return; } + + if (strcmp(inner_element, ALLOW_EMPTY_ELEMENT) == 0) + { + VERB2 log("allow-empty:'%s'", text_copy); + opt->allow_empty = string_to_bool(text_copy); + return; + } /* if (strcmp(inner_element, DESCRIPTION_ELEMENT) == 0) {
Seems ok, please apply.
On 03/21/2011 02:30 PM, Nikola Pajkovsky wrote:
Signed-off-by: Nikola Pajkovskynpajkovs@redhat.com
src/include/report/event_config.h | 1 + src/lib/event_xml_parser.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/include/report/event_config.h b/src/include/report/event_config.h index cc6c15b..12beefe 100644 --- a/src/include/report/event_config.h +++ b/src/include/report/event_config.h @@ -52,6 +52,7 @@ typedef struct char *value; char *label; option_type_t type;
- int allow_empty; //char *description; //can be used as tooltip in gtk app //char *allowed_value; //int required;
diff --git a/src/lib/event_xml_parser.c b/src/lib/event_xml_parser.c index 9277aea..7432913 100644 --- a/src/lib/event_xml_parser.c +++ b/src/lib/event_xml_parser.c @@ -64,7 +64,8 @@ static void consume_cur_option(struct my_parse_data *parse_data) }
event_config_t *event_config = parse_data->event_config;
- GList *elem = g_list_find_custom(event_config->options, opt->name,&cmp_event_option_name_with_string);
- GList *elem = g_list_find_custom(event_config->options, opt->name,
+&cmp_event_option_name_with_string); if (elem) { /* we already have option with such name */ @@ -111,8 +112,7 @@ static void start_element(GMarkupParseContext *context,
event_option_t *opt = parse_data->cur_option = new_event_option();
int i;
for (i = 0; attribute_names[i] != NULL; ++i)
for (int i = 0; attribute_names[i] != NULL; ++i) { VERB2 log("attr: %s:%s", attribute_names[i], attribute_values[i]); if (strcmp(attribute_names[i], "name") == 0)
@@ -187,6 +187,13 @@ static void text(GMarkupParseContext *context, opt->value = text_copy; return; }
if (strcmp(inner_element, ALLOW_EMPTY_ELEMENT) == 0)
{
VERB2 log("allow-empty:'%s'", text_copy);
opt->allow_empty = string_to_bool(text_copy);
return;
} /* if (strcmp(inner_element, DESCRIPTION_ELEMENT) == 0) {
crash-catcher@lists.fedorahosted.org