summaryrefslogtreecommitdiffstats
path: root/src/lib/event_xml_parser.c
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2011-03-08 21:31:45 +0100
committerJiri Moskovcak <jmoskovc@redhat.com>2011-03-08 21:31:45 +0100
commite2fdf6c58eba440770624d13e25a63c3d77040db (patch)
tree37e4569af212b47339fa8e6c895e29a22eeaaecf /src/lib/event_xml_parser.c
parenta6ee8958dbe6f45f95fca4fa2ea1490c7035be65 (diff)
downloadabrt-e2fdf6c58eba440770624d13e25a63c3d77040db.tar.gz
abrt-e2fdf6c58eba440770624d13e25a63c3d77040db.tar.xz
abrt-e2fdf6c58eba440770624d13e25a63c3d77040db.zip
added event description support into xml parser
- so event now has: action: description of what will happen when this event is used - the main purpose is for the event selector in wizard description: description of the event
Diffstat (limited to 'src/lib/event_xml_parser.c')
-rw-r--r--src/lib/event_xml_parser.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/lib/event_xml_parser.c b/src/lib/event_xml_parser.c
index 5126022e..a0e6c3c4 100644
--- a/src/lib/event_xml_parser.c
+++ b/src/lib/event_xml_parser.c
@@ -135,8 +135,13 @@ static void text(GMarkupParseContext *context,
ui->name = _text;
return;
}
+ if(strcmp(inner_element, DESCRIPTION_ELEMENT) == 0)
+ {
+ VERB2 log("event description:'%s'", _text);
+ free(ui->description);
+ ui->description = _text;
+ }
}
- free(_text);
}
// Called for strings that should be re-saved verbatim in this same
@@ -181,13 +186,16 @@ void load_event_description_from_file(event_config_t *event_config, const char*
event_config, /*GDestroyNotify:*/ NULL);
FILE* fin = fopen(filename, "r");
- size_t read_bytes = 0;
- char buff[1024];
- while ((read_bytes = fread(buff, 1, 1024, fin)))
+ if(fin != NULL)
{
- g_markup_parse_context_parse(context, buff, read_bytes, NULL);
+ size_t read_bytes = 0;
+ char buff[1024];
+ while ((read_bytes = fread(buff, 1, 1024, fin)))
+ {
+ g_markup_parse_context_parse(context, buff, read_bytes, NULL);
+ }
+ fclose(fin);
}
- fclose(fin);
g_markup_parse_context_free(context);
}