aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2003-03-28 05:37:07 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2003-03-28 05:37:07 +0800
commitc6ed3eedc881b57ac7d767a282413db7966f8a8b (patch)
tree18ded69ef658a974fc9c012ac09c63c9ed9f3858
parenta764639cd2f9f85da377fa6987c10bc1005d74ef (diff)
downloadgsoc2013-evolution-c6ed3eedc881b57ac7d767a282413db7966f8a8b.tar
gsoc2013-evolution-c6ed3eedc881b57ac7d767a282413db7966f8a8b.tar.gz
gsoc2013-evolution-c6ed3eedc881b57ac7d767a282413db7966f8a8b.tar.bz2
gsoc2013-evolution-c6ed3eedc881b57ac7d767a282413db7966f8a8b.tar.lz
gsoc2013-evolution-c6ed3eedc881b57ac7d767a282413db7966f8a8b.tar.xz
gsoc2013-evolution-c6ed3eedc881b57ac7d767a282413db7966f8a8b.tar.zst
gsoc2013-evolution-c6ed3eedc881b57ac7d767a282413db7966f8a8b.zip
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
-rw-r--r--my-evolution/ChangeLog14
-rw-r--r--my-evolution/e-summary-mail.c6
-rw-r--r--my-evolution/e-summary-rdf.c48
-rw-r--r--my-evolution/e-summary-tasks.c20
-rw-r--r--my-evolution/e-summary-weather.c28
-rw-r--r--my-evolution/e-summary.c6
6 files changed, 56 insertions, 66 deletions
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 <ettore@ximian.com>
+
+ [#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 <NotZed@Ximian.com>
** 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 ("<dl><dt><img src=\"myevo-mail-summary.png\" "
"align=\"middle\" alt=\"\" width=\"48\" "
"height=\"48\"> <b><a href=\"evolution:/local/Inbox\">");
- 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, "</a></b></dt><dd><table numcols=\"2\" width=\"100%\">");
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, "<a href=\"%s\">", 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, "</a>");
+
+ 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, "</a>");
g_string_append (html, "</b></dt>");
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</A></font></li>", 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</A></font></li>");
}
g_string_append (html, "</UL>");
}
@@ -298,16 +301,9 @@ display_doc (RDF *r)
"width=\"48\" height=\"48\">");
if (r->cache == NULL) {
- char *tmp_utf, *str;
-
- str = g_strdup_printf ("<b>%s:</b><br>%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, "</dt>");
- g_free (tmp_utf);
+ g_string_append_printf (html, "<b>%s:</b><br>%s</dt>",
+ _("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 ("<dl><dt><img src=\"myevo-post-it.png\" align=\"middle\" "
- "alt=\"\" width=\"48\" height=\"48\"> <b><a href=\"", tasks->default_uri, "\">",
- s1, "</a></b></dt><dd><b>", s2, "</b></dd></dl>", NULL);
- g_free (s1);
- g_free (s2);
-
+ "alt=\"\" width=\"48\" height=\"48\"> "
+ "<b><a href=\"", tasks->default_uri, "\">",
+ _("Tasks"),
+ "</a></b></dt><dd><b>", _("No tasks"), "</b></dd></dl>",
+ NULL);
return FALSE;
} else {
char *s;
@@ -340,11 +336,9 @@ generate_html (gpointer data)
string = g_string_new (NULL);
g_string_sprintf (string, "<dl><dt><img src=\"myevo-post-it.png\" align=\"middle\" "
"alt=\"\" width=\"48\" height=\"48\"> <b><a href=\"%s\">", 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, "</a></b></dt><dd>");
+
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 ("<dl><img src=\"ico-weather.png\" align=\"middle\" "
"alt=\"\" width=\"48\" height=\"48\"><b>"
"<a href=\"http://www.metoffice.gov.uk\">");
- 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, "</a></b>");
+
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 ("<br><b>%s %s</b></br>",
- _("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 ("<br><b>%s %s</b></br>",
+ _("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);