summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/include/report/event_config.h1
-rw-r--r--src/lib/event_config.c6
-rw-r--r--src/lib/event_xml_parser.c20
-rw-r--r--src/plugins/Bugzilla.xml3
4 files changed, 21 insertions, 9 deletions
diff --git a/src/include/report/event_config.h b/src/include/report/event_config.h
index d2624e60..e2310885 100644
--- a/src/include/report/event_config.h
+++ b/src/include/report/event_config.h
@@ -61,6 +61,7 @@ typedef struct
char *name; //name of the event "Bugzilla" "RedHat Support Uploader"
char *title; //window title - not used right now, maybe the "name" is enough?
char *action;//action description to show in gui like: Upload report to the Red Hat bugzilla"
+ char *description;
GList *options;
} event_config_t;
diff --git a/src/lib/event_config.c b/src/lib/event_config.c
index 18019178..30335b84 100644
--- a/src/lib/event_config.c
+++ b/src/lib/event_config.c
@@ -31,6 +31,7 @@ void free_event_config(event_config_t *p)
free(p->name);
free(p->title);
free(p->action);
+ free(p->description);
for (GList *opt = p->options; opt; opt = opt->next)
free_event_option(opt->data);
g_list_free(p->options);
@@ -42,7 +43,6 @@ void free_event_config(event_config_t *p)
void load_event_config_data(void)
{
free_event_config_data();
-
DIR *dir = opendir(EVENTS_DIR);
if (!dir)
return;
@@ -72,12 +72,14 @@ void load_event_config_data(void)
char *fullname = concat_path_file(EVENTS_DIR, dent->d_name);
if (xml)
load_event_description_from_file(event_config, fullname);
+
// if (conf)
// load_event_values_from_file(event_config, fullname);
free(fullname);
- *ext = '\0';
+ //we did ext++ so we need ext-- to point to '.'
+ *(--ext) = '\0';
g_hash_table_replace(g_event_config_list, xstrdup(dent->d_name), event_config);
}
}
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);
}
diff --git a/src/plugins/Bugzilla.xml b/src/plugins/Bugzilla.xml
index b8bd6e7a..bc8e8ecb 100644
--- a/src/plugins/Bugzilla.xml
+++ b/src/plugins/Bugzilla.xml
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<event>
<name>Bugzilla</name>
- <action>_Report this problem to the Red Hat bug tracker</action>
+ <action>Report this problem to the Red Hat bug tracker</action>
+ <description>Reports selected problems to the Red Hat bug tracker</description>
<options>
<option type="text" name="Bugzilla_BugzillaURL">
<label>Bugzilla URL</label>