aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-04-14 00:07:53 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-04-14 00:07:53 +0800
commitae436d4fdc2d7a6f9580b2e17cc32dfd33255f9f (patch)
treeeb905ca6576b7626b08b8249b4bfb9fd30ba290b
parent230d74c4640640a083d2bc56325e8db2b4c2172d (diff)
downloadgsoc2013-evolution-ae436d4fdc2d7a6f9580b2e17cc32dfd33255f9f.tar
gsoc2013-evolution-ae436d4fdc2d7a6f9580b2e17cc32dfd33255f9f.tar.gz
gsoc2013-evolution-ae436d4fdc2d7a6f9580b2e17cc32dfd33255f9f.tar.bz2
gsoc2013-evolution-ae436d4fdc2d7a6f9580b2e17cc32dfd33255f9f.tar.lz
gsoc2013-evolution-ae436d4fdc2d7a6f9580b2e17cc32dfd33255f9f.tar.xz
gsoc2013-evolution-ae436d4fdc2d7a6f9580b2e17cc32dfd33255f9f.tar.zst
gsoc2013-evolution-ae436d4fdc2d7a6f9580b2e17cc32dfd33255f9f.zip
EWebView: Fix icon retrieval when showing EAlerts.
Need to convert the icon filename to a URI for use in <img> tags.
-rw-r--r--widgets/misc/e-web-view.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/widgets/misc/e-web-view.c b/widgets/misc/e-web-view.c
index 5e25475eca..347e8f1127 100644
--- a/widgets/misc/e-web-view.c
+++ b/widgets/misc/e-web-view.c
@@ -1064,8 +1064,11 @@ web_view_submit_alert (EAlertSink *alert_sink,
GtkWidget *dialog;
GString *buffer;
const gchar *icon_name = NULL;
+ const gchar *filename;
gpointer parent;
+ gchar *icon_uri;
gint size = 0;
+ GError *error = NULL;
web_view = E_WEB_VIEW (alert_sink);
@@ -1101,6 +1104,14 @@ web_view_submit_alert (EAlertSink *alert_sink,
icon_name, size, GTK_ICON_LOOKUP_NO_SVG);
g_return_if_fail (icon_info != NULL);
+ filename = gtk_icon_info_get_filename (icon_info);
+ icon_uri = g_filename_to_uri (filename, NULL, &error);
+
+ if (error != NULL) {
+ g_warning ("%s", error->message);
+ g_clear_error (&error);
+ }
+
buffer = g_string_sized_new (512);
g_string_append (
@@ -1132,7 +1143,7 @@ web_view_submit_alert (EAlertSink *alert_sink,
"%s"
"</td>"
"</tr>",
- gtk_icon_info_get_filename (icon_info),
+ icon_uri,
e_alert_get_primary_text (alert),
e_alert_get_secondary_text (alert));
@@ -1150,6 +1161,7 @@ web_view_submit_alert (EAlertSink *alert_sink,
g_string_free (buffer, TRUE);
gtk_icon_info_free (icon_info);
+ g_free (icon_uri);
}
static void