summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNikola Pajkovsky <npajkovs@redhat.com>2011-03-17 16:15:14 +0100
committerNikola Pajkovsky <npajkovs@redhat.com>2011-03-22 12:02:48 +0100
commit7de7895acbd189a0be5212583d78dacecd6984db (patch)
tree20ba4bebf8a07433d44251562bc057d7c2ae8753 /src
parent40f58f66e99fa8381c4ed68b88508692ed9a3f9e (diff)
downloadabrt-7de7895acbd189a0be5212583d78dacecd6984db.tar.gz
abrt-7de7895acbd189a0be5212583d78dacecd6984db.tar.xz
abrt-7de7895acbd189a0be5212583d78dacecd6984db.zip
parse and store 'allow-empty' value
Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/include/report/event_config.h1
-rw-r--r--src/lib/event_xml_parser.c13
2 files changed, 11 insertions, 3 deletions
diff --git a/src/include/report/event_config.h b/src/include/report/event_config.h
index cc6c15b0..12beefe7 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 9277aea4..74329134 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)
{