From c6ed3eedc881b57ac7d767a282413db7966f8a8b Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Thu, 27 Mar 2003 21:37:07 +0000 Subject: Likewise. * e-summary.c (e_summary_init): Likewise. * e-summary-weather.c (e_summary_weather_get_html): Likewise. (weather_make_html): Likewise. * e-summary-mail.c (e_summary_mail_generate_html): Fix so it handles the fact that the translated strings are already in UTF8. * e-summary-rdf.c (tree_walk): Likewise. (display_doc): Likewise. svn path=/trunk/; revision=20553 --- my-evolution/ChangeLog | 14 ++++++++++++ my-evolution/e-summary-mail.c | 6 ++--- my-evolution/e-summary-rdf.c | 48 ++++++++++++++++++---------------------- my-evolution/e-summary-tasks.c | 20 ++++++----------- my-evolution/e-summary-weather.c | 28 ++++++++--------------- my-evolution/e-summary.c | 6 ++--- 6 files changed, 56 insertions(+), 66 deletions(-) (limited to 'my-evolution') diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog index d6c5b9c125..e8e66eb5e8 100644 --- a/my-evolution/ChangeLog +++ b/my-evolution/ChangeLog @@ -1,3 +1,17 @@ +2003-03-27 Ettore Perazzoli + + [#40358] + + * e-summary.c (e_summary_init): Likewise. + + * e-summary-weather.c (e_summary_weather_get_html): Likewise. + (weather_make_html): Likewise. + + * e-summary-mail.c (e_summary_mail_generate_html): Fix so it + handles the fact that the translated strings are already in UTF8. + * e-summary-rdf.c (tree_walk): Likewise. + (display_doc): Likewise. + 2003-03-27 Not Zed ** see bug #40141 diff --git a/my-evolution/e-summary-mail.c b/my-evolution/e-summary-mail.c index 94b7ec8aa2..51513f23b1 100644 --- a/my-evolution/e-summary-mail.c +++ b/my-evolution/e-summary-mail.c @@ -176,7 +176,7 @@ e_summary_mail_generate_html (ESummary *summary) ESummaryMail *mail; GString *string; GList *p; - char *s, *old; + char *old; g_return_if_fail (summary != NULL); g_return_if_fail (IS_E_SUMMARY (summary)); @@ -185,9 +185,7 @@ e_summary_mail_generate_html (ESummary *summary) string = g_string_new ("
\"\" "); - s = e_utf8_from_locale_string (_("Mail summary")); - g_string_append (string, s); - g_free (s); + g_string_append (string, _("Mail summary")); g_string_append (string, "
"); for (p = folder_store->shown; p; p = p->next) { diff --git a/my-evolution/e-summary-rdf.c b/my-evolution/e-summary-rdf.c index b7667b2a99..70ce86687d 100644 --- a/my-evolution/e-summary-rdf.c +++ b/my-evolution/e-summary-rdf.c @@ -251,15 +251,17 @@ tree_walk (xmlNodePtr root, if (*u != '\0') g_string_sprintfa (html, "", u); - if (r->cache->encoding) - t = e_utf8_from_charset_string (r->cache->encoding, t); - else - t = e_utf8_from_locale_string (t); - g_string_append (html, t); - g_free (t); - if (*u != '\0') { - g_string_append (html, ""); + + if (r->cache->encoding) { + char *tmp = e_utf8_from_charset_string (r->cache->encoding, t); + g_string_append (html, tmp); + g_free (tmp); + } else { + g_string_append (html, t); } + + if (*u != '\0') + g_string_append (html, ""); g_string_append (html, ""); if (r->shown == FALSE) { @@ -277,14 +279,15 @@ tree_walk (xmlNodePtr root, g_string_append (html, tmp); g_free (tmp); - if (r->cache->encoding) - p = e_utf8_from_charset_string (r->cache->encoding, p); - else - p = e_utf8_from_locale_string (p); - tmp = g_strdup_printf ("%s\n", p); - g_free (p); - g_string_append (html, tmp); - g_free (tmp); + if (r->cache->encoding) { + char *tmp = e_utf8_from_charset_string (r->cache->encoding, p); + g_string_append (html, tmp); + g_free (tmp); + } else { + g_string_append (html, p); + } + + g_string_append (html, "\n"); } g_string_append (html, ""); } @@ -298,16 +301,9 @@ display_doc (RDF *r) "width=\"48\" height=\"48\">"); if (r->cache == NULL) { - char *tmp_utf, *str; - - str = g_strdup_printf ("%s:
%s", _("Error downloading RDF"), - r->uri); - tmp_utf = e_utf8_from_locale_string (str); - g_free (str); - - g_string_append (html, tmp_utf); - g_string_append (html, ""); - g_free (tmp_utf); + g_string_append_printf (html, "%s:
%s", + _("Error downloading RDF"), + r->uri); } else { tree_walk (xmlDocGetRootElement (r->cache), r, html); } diff --git a/my-evolution/e-summary-tasks.c b/my-evolution/e-summary-tasks.c index 69ba5c74af..578c2bf737 100644 --- a/my-evolution/e-summary-tasks.c +++ b/my-evolution/e-summary-tasks.c @@ -321,17 +321,13 @@ generate_html (gpointer data) } if (uids == NULL) { - char *s1, *s2; - - s1 = e_utf8_from_locale_string (_("Tasks")); - s2 = e_utf8_from_locale_string (_("No tasks")); g_free (tasks->html); tasks->html = g_strconcat ("
default_uri, "\">", - s1, "
", s2, "
", NULL); - g_free (s1); - g_free (s2); - + "alt=\"\" width=\"48\" height=\"48\"> " + "default_uri, "\">", + _("Tasks"), + "
", _("No tasks"), "
", + NULL); return FALSE; } else { char *s; @@ -340,11 +336,9 @@ generate_html (gpointer data) string = g_string_new (NULL); g_string_sprintf (string, "
", tasks->default_uri); - - s = e_utf8_from_locale_string (_("Tasks")); - g_string_append (string, s); - g_free (s); + g_string_append (string, _("Tasks")); g_string_append (string, "
"); + for (l = uids; l; l = l->next) { char *uid; CalComponent *comp; diff --git a/my-evolution/e-summary-weather.c b/my-evolution/e-summary-weather.c index a6a2497370..27bb777083 100644 --- a/my-evolution/e-summary-weather.c +++ b/my-evolution/e-summary-weather.c @@ -70,10 +70,9 @@ e_summary_weather_get_html (ESummary *summary) string = g_string_new ("
" ""); - s = e_utf8_from_locale_string (_("My Weather")); - g_string_append (string, s); - g_free (s); + g_string_append (string, _("My Weather")); g_string_append (string, ""); + for (weathers = summary->weather->weathers; weathers; weathers = weathers->next) { if (((Weather *)weathers->data)->html == NULL) { continue; @@ -133,17 +132,12 @@ weather_make_html (Weather *w) temp = weather_temp_string (w); cond = (char *) weather_conditions_string (w); - s = e_utf8_from_locale_string (sky); - g_string_append (string, s); - g_free (s); + g_string_append (string, sky); g_string_append_c (string, ' '); - s = e_utf8_from_locale_string (cond); - g_string_append (string, s); - g_free (s); + g_string_append (string, cond); g_string_append_c (string, ' '); - s = e_utf8_from_locale_string (temp); - g_string_append (string, s); - g_free (s); + g_string_append (string, temp); + g_free (temp); #if 0 @@ -256,7 +250,6 @@ message_finished (SoupMessage *msg, } if (SOUP_MESSAGE_IS_ERROR (msg)) { - char *mess; ESummaryWeatherLocation *location; g_warning ("Message failed: %d\n%s", msg->errorcode, @@ -265,12 +258,9 @@ message_finished (SoupMessage *msg, location = g_hash_table_lookup (locations_hash, w->location); - mess = g_strdup_printf ("
%s %s
", - _("There was an error downloading data for"), - location ? location->name : w->location); - - w->html = e_utf8_from_locale_string (mess); - g_free (mess); + w->html = g_strdup_printf ("
%s %s
", + _("There was an error downloading data for"), + location ? location->name : w->location); e_summary_draw (w->summary); return; diff --git a/my-evolution/e-summary.c b/my-evolution/e-summary.c index bc7316d107..300b44e14f 100644 --- a/my-evolution/e-summary.c +++ b/my-evolution/e-summary.c @@ -503,7 +503,7 @@ e_summary_init (ESummary *summary) GConfClient *gconf_client; ESummaryPrivate *priv; GdkColor bgcolor = {0, 0xffff, 0xffff, 0xffff}; - char *def, *default_utf; + char *def; summary->priv = g_new (ESummaryPrivate, 1); @@ -522,10 +522,8 @@ e_summary_init (ESummary *summary) "text/html; charset=utf-8"); gtk_html_set_default_background_color (GTK_HTML (priv->html), &bgcolor); def = g_strdup_printf (DEFAULT_HTML, _("Please wait...")); - default_utf = e_utf8_from_locale_string (def); - gtk_html_load_from_string (GTK_HTML (priv->html), default_utf, strlen (default_utf)); + gtk_html_load_from_string (GTK_HTML (priv->html), def, strlen (def)); g_free (def); - g_free (default_utf); g_signal_connect (priv->html, "url-requested", G_CALLBACK (e_summary_url_requested), summary); g_signal_connect (priv->html, "link-clicked", G_CALLBACK (e_summary_url_clicked), summary); -- cgit v1.2.3