diff options
author | Vardhman Jain <vardhman@students.iiit.net> | 2004-06-07 20:37:02 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2004-06-07 20:37:02 +0800 |
commit | 5914e863dd76b7d7800170aae25a5c9a45ebf40d (patch) | |
tree | 192caa990aefabba8eabd5e004aba0b034f2e353 /calendar/gui | |
parent | 87d3cee98b29060ab6bde0fb56180363f7c2e303 (diff) | |
download | gsoc2013-evolution-5914e863dd76b7d7800170aae25a5c9a45ebf40d.tar.gz gsoc2013-evolution-5914e863dd76b7d7800170aae25a5c9a45ebf40d.tar.zst gsoc2013-evolution-5914e863dd76b7d7800170aae25a5c9a45ebf40d.zip |
Bug #36247 Changes to improve the performance of _(str) function call on
2004-06-06 Vardhman Jain <vardhman@students.iiit.net>
* 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 <tar>str</tag> to avoid translation of tag.
svn path=/trunk/; revision=26235
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/e-itip-control.c | 23 |
1 files changed, 18 insertions, 5 deletions
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 ("<b>%s:</b>", _("Starts")); write_label_piece (itip, &datetime, buffer, 1024, - _("<b>Starts:</b> "), + str, "<br>", 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, _("<b>Ends:</b> "), "<br>", FALSE); + str = g_strdup_printf ("<b>%s:</b>", _("Ends")); + write_label_piece (itip, &datetime, buffer, 1024, str, "<br>", 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 ("<b>%s:</b>", _("Completed")); datetime.value->is_utc = TRUE; - write_label_piece (itip, &datetime, buffer, 1024, _("<b>Completed:</b> "), "<br>", FALSE); + write_label_piece (itip, &datetime, buffer, 1024, str, "<br>", 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, _("<b>Due:</b> "), "<br>", FALSE); + str = g_strdup_printf ("<b>%s:</b>", _("Due")); + write_label_piece (itip, &datetime, buffer, 1024, str, "<br>", 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) : _("<i>None</i>"); + str = g_strdup_printf ("<i>%s:</i>", _("None")); + + html = text.value ? camel_text_to_html (text.value, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0) : str; gtk_html_stream_printf (html_stream, "<b>%s</b><br>%s<br><br>", _("Summary:"), html); + g_free (str); if (text.value) g_free (html); |