aboutsummaryrefslogtreecommitdiffstats
path: root/my-evolution/e-summary-calendar.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2003-03-14 06:37:21 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2003-03-14 06:37:21 +0800
commit959f74d6c632ceb8746ebec018b6e4ca828ee0ff (patch)
tree7c7c7ad39326a4b468cb3fe9122639214a66b4a0 /my-evolution/e-summary-calendar.c
parent5a8fb211febd4eaa5731da0a18c4a30c19fb1f82 (diff)
downloadgsoc2013-evolution-959f74d6c632ceb8746ebec018b6e4ca828ee0ff.tar.gz
gsoc2013-evolution-959f74d6c632ceb8746ebec018b6e4ca828ee0ff.tar.zst
gsoc2013-evolution-959f74d6c632ceb8746ebec018b6e4ca828ee0ff.zip
(generate_html): Changed so its printf()s
are protected against default_uri being NULL. Also, no need to do e_utf8_from_locale_string() anymore. svn path=/trunk/; revision=20281
Diffstat (limited to 'my-evolution/e-summary-calendar.c')
-rw-r--r--my-evolution/e-summary-calendar.c40
1 files changed, 16 insertions, 24 deletions
diff --git a/my-evolution/e-summary-calendar.c b/my-evolution/e-summary-calendar.c
index 12172e4764..7c5a5cbea7 100644
--- a/my-evolution/e-summary-calendar.c
+++ b/my-evolution/e-summary-calendar.c
@@ -371,33 +371,24 @@ generate_html (gpointer data)
uids = cal_client_get_objects_in_range (calendar->client,
CALOBJ_TYPE_EVENT, begin, end);
- if (uids == NULL) {
- char *s1, *s2;
+ string = g_string_new ("<dl><dt><img src=\"myevo-appointments.png\" align=\"middle\" "
+ "alt=\"\" width=\"48\" height=\"48\"> <b>");
- s1 = e_utf8_from_locale_string (_("Appointments"));
- s2 = e_utf8_from_locale_string (_("No appointments"));
- g_free (calendar->html);
- calendar->html = g_strconcat ("<dl><dt><img src=\"myevo-appointments.png\" align=\"middle\" "
- "alt=\"\" width=\"48\" height=\"48\"> <b><a href=\"", calendar->default_uri, "\">",
- s1, "</a></b></dt><dd><b>", s2, "</b></dd></dl>", NULL);
- g_free (s1);
- g_free (s2);
+ if (calendar->default_uri != NULL)
+ g_string_append_printf (string, "<a href=\"%s\">", calendar->default_uri);
- e_summary_draw (summary);
- return FALSE;
- } else {
+ g_string_append (string, _("Appointments"));
+
+ if (calendar->default_uri != NULL)
+ g_string_append (string, "</a>");
+
+ g_string_append (string, "</b></dt><dd>");
+
+ if (uids == NULL) {
+ g_string_append (string, _("No appointments."));
+ } else {
GPtrArray *uidarray;
int i;
- char *s;
-
- string = g_string_new (NULL);
- g_string_sprintf (string, "<dl><dt><img src=\"myevo-appointments.png\" align=\"middle\" "
- "alt=\"\" width=\"48\" height=\"48\"> <b><a href=\"%s\">",
- calendar->default_uri);
- s = e_utf8_from_locale_string (_("Appointments"));
- g_string_append (string, s);
- g_free (s);
- g_string_append (string, "</a></b></dt><dd>");
uidarray = uids_to_array (summary, calendar->client, uids, begin, end);
for (i = 0; i < uidarray->len; i++) {
@@ -439,9 +430,10 @@ generate_html (gpointer data)
}
free_event_array (uidarray);
- g_string_append (string, "</dd></dl>");
}
+ g_string_append (string, "</dd></dl>");
+
if (calendar->html) {
g_free (calendar->html);
}