From 5914e863dd76b7d7800170aae25a5c9a45ebf40d Mon Sep 17 00:00:00 2001 From: Vardhman Jain Date: Mon, 7 Jun 2004 12:37:02 +0000 Subject: Bug #36247 Changes to improve the performance of _(str) function call on 2004-06-06 Vardhman Jain * Bug #36247 * gui/e-itip-control.c (write_html, set_date_label): Changes to improve the performance of _(str) function call on strings str of the type str to avoid translation of tag. svn path=/trunk/; revision=26235 --- calendar/gui/e-itip-control.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'calendar/gui') diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c index ad0503001a..6bbe1dfb4d 100644 --- a/calendar/gui/e-itip-control.c +++ b/calendar/gui/e-itip-control.c @@ -672,6 +672,7 @@ set_date_label (EItipControl *itip, GtkHTML *html, GtkHTMLStream *html_stream, EItipControlPrivate *priv; ECalComponentDateTime datetime; static char buffer[1024]; + gchar *str; gboolean wrote = FALSE, task_completed = FALSE; ECalComponentVType type; @@ -682,20 +683,24 @@ set_date_label (EItipControl *itip, GtkHTML *html, GtkHTMLStream *html_stream, buffer[0] = '\0'; e_cal_component_get_dtstart (comp, &datetime); if (datetime.value) { + str = g_strdup_printf ("%s:", _("Starts")); write_label_piece (itip, &datetime, buffer, 1024, - _("Starts: "), + str, "
", FALSE); gtk_html_write (html, html_stream, buffer, strlen(buffer)); wrote = TRUE; + g_free (str); } e_cal_component_free_datetime (&datetime); buffer[0] = '\0'; e_cal_component_get_dtend (comp, &datetime); if (datetime.value){ - write_label_piece (itip, &datetime, buffer, 1024, _("Ends: "), "
", FALSE); + str = g_strdup_printf ("%s:", _("Ends")); + write_label_piece (itip, &datetime, buffer, 1024, str, "
", FALSE); gtk_html_write (html, html_stream, buffer, strlen (buffer)); wrote = TRUE; + g_free (str); } e_cal_component_free_datetime (&datetime); @@ -712,20 +717,24 @@ set_date_label (EItipControl *itip, GtkHTML *html, GtkHTMLStream *html_stream, if (type == E_CAL_COMPONENT_TODO && datetime.value) { /* Pass TRUE as is_utc, so it gets converted to the current timezone. */ + str = g_strdup_printf ("%s:", _("Completed")); datetime.value->is_utc = TRUE; - write_label_piece (itip, &datetime, buffer, 1024, _("Completed: "), "
", FALSE); + write_label_piece (itip, &datetime, buffer, 1024, str, "
", FALSE); gtk_html_write (html, html_stream, buffer, strlen (buffer)); wrote = TRUE; task_completed = TRUE; + g_free (str); } e_cal_component_free_datetime (&datetime); buffer[0] = '\0'; e_cal_component_get_due (comp, &datetime); if (type == E_CAL_COMPONENT_TODO && !task_completed && datetime.value) { - write_label_piece (itip, &datetime, buffer, 1024, _("Due: "), "
", FALSE); + str = g_strdup_printf ("%s:", _("Due")); + write_label_piece (itip, &datetime, buffer, 1024, str, "
", FALSE); gtk_html_write (html, html_stream, buffer, strlen (buffer)); wrote = TRUE; + g_free (str); } e_cal_component_free_datetime (&datetime); @@ -807,6 +816,7 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title, gchar *html; const gchar *const_html; gchar *filename; + gchar *str; priv = itip->priv; @@ -915,9 +925,12 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title, /* Summary */ e_cal_component_get_summary (priv->comp, &text); - html = text.value ? camel_text_to_html (text.value, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0) : _("None"); + str = g_strdup_printf ("%s:", _("None")); + + html = text.value ? camel_text_to_html (text.value, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0) : str; gtk_html_stream_printf (html_stream, "%s
%s

", _("Summary:"), html); + g_free (str); if (text.value) g_free (html); -- cgit