summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2011-03-13 15:46:30 +0100
committerJiri Moskovcak <jmoskovc@redhat.com>2011-03-13 15:46:30 +0100
commit6d1f476a71a9c61a90f49edda008ae3c2a340d65 (patch)
treef9b89d5b7b5c06f4cd1ffeb84b82108514fada11 /src/lib
parent1b965a9923557dc201786901f138654f393773d2 (diff)
downloadabrt-6d1f476a71a9c61a90f49edda008ae3c2a340d65.tar.gz
abrt-6d1f476a71a9c61a90f49edda008ae3c2a340d65.tar.xz
abrt-6d1f476a71a9c61a90f49edda008ae3c2a340d65.zip
teach event xml parser to understand <default-value>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/event_xml_parser.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/lib/event_xml_parser.c b/src/lib/event_xml_parser.c
index c144d845..f24606e0 100644
--- a/src/lib/event_xml_parser.c
+++ b/src/lib/event_xml_parser.c
@@ -1,13 +1,14 @@
#include "abrtlib.h"
#include "event_config.h"
-#define EVENT_ELEMENT "event"
-#define LABEL_ELEMENT "label"
-#define DESCRIPTION_ELEMENT "description"
-#define ALLOW_EMPTY_ELEMENT "allow-empty"
-#define OPTION_ELEMENT "option"
-//#define ACTION_ELEMENT "action"
-#define NAME_ELEMENT "name"
+#define EVENT_ELEMENT "event"
+#define LABEL_ELEMENT "label"
+#define DESCRIPTION_ELEMENT "description"
+#define ALLOW_EMPTY_ELEMENT "allow-empty"
+#define OPTION_ELEMENT "option"
+//#define ACTION_ELEMENT "action"
+#define NAME_ELEMENT "name"
+#define DEFAULT_VALUE_ELEMENT "default-value"
struct my_parse_data
{
@@ -156,6 +157,19 @@ static void text(GMarkupParseContext *context,
return;
}
/*
+ * we can add a separate filed for the default value
+ * in that case we can implement features like "reset to default value"
+ * but for now using "value" should be enough and clients doesn't
+ * have to know about the "defaul-value"
+ */
+ if (strcmp(inner_element, DEFAULT_VALUE_ELEMENT) == 0)
+ {
+ VERB2 log("default value:'%s'", text_copy);
+ free(opt->value);
+ opt->value = text_copy;
+ return;
+ }
+ /*
if (strcmp(inner_element, DESCRIPTION_ELEMENT) == 0)
{
VERB2 log("tooltip:'%s'", text_copy);