From 959f74d6c632ceb8746ebec018b6e4ca828ee0ff Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Thu, 13 Mar 2003 22:37:21 +0000 Subject: (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 --- my-evolution/ChangeLog | 7 +++++++ my-evolution/e-summary-calendar.c | 40 ++++++++++++++++----------------------- 2 files changed, 23 insertions(+), 24 deletions(-) (limited to 'my-evolution') diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog index f40f7d2674..12cac98092 100644 --- a/my-evolution/ChangeLog +++ b/my-evolution/ChangeLog @@ -1,3 +1,9 @@ +2003-03-13 Ettore Perazzoli + + * e-summary-calendar.c (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. + 2003-03-12 Dan Winship * e-summary-shown.c (e_summary_shown_freeze, @@ -41,6 +47,7 @@ (e_summary_tasks_protocol): Likewise. * e-summary-weather.c (e_summary_weather_update): Likewise. +>>>>>>> 1.264 2003-03-05 Ettore Perazzoli * e-summary-weather.c (e_summary_weather_set_online): Likewise, 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 ("
"); - s1 = e_utf8_from_locale_string (_("Appointments")); - s2 = e_utf8_from_locale_string (_("No appointments")); - g_free (calendar->html); - calendar->html = g_strconcat ("
default_uri, "\">", - s1, "
", s2, "
", NULL); - g_free (s1); - g_free (s2); + if (calendar->default_uri != NULL) + g_string_append_printf (string, "", calendar->default_uri); - e_summary_draw (summary); - return FALSE; - } else { + g_string_append (string, _("Appointments")); + + if (calendar->default_uri != NULL) + g_string_append (string, ""); + + g_string_append (string, "
"); + + 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, "
", - calendar->default_uri); - s = e_utf8_from_locale_string (_("Appointments")); - g_string_append (string, s); - g_free (s); - g_string_append (string, "
"); 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, "
"); } + g_string_append (string, "
"); + if (calendar->html) { g_free (calendar->html); } -- cgit v1.2.3