aboutsummaryrefslogtreecommitdiffstats
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
parent5a8fb211febd4eaa5731da0a18c4a30c19fb1f82 (diff)
downloadgsoc2013-evolution-959f74d6c632ceb8746ebec018b6e4ca828ee0ff.tar
gsoc2013-evolution-959f74d6c632ceb8746ebec018b6e4ca828ee0ff.tar.gz
gsoc2013-evolution-959f74d6c632ceb8746ebec018b6e4ca828ee0ff.tar.bz2
gsoc2013-evolution-959f74d6c632ceb8746ebec018b6e4ca828ee0ff.tar.lz
gsoc2013-evolution-959f74d6c632ceb8746ebec018b6e4ca828ee0ff.tar.xz
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
-rw-r--r--my-evolution/ChangeLog7
-rw-r--r--my-evolution/e-summary-calendar.c40
2 files changed, 23 insertions, 24 deletions
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 <ettore@ximian.com>
+
+ * 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 <danw@ximian.com>
* 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 <ettore@ximian.com>
* 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 ("<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);
}