aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorDan Vrátil <dvratil@redhat.com>2012-06-27 19:50:54 +0800
committerDan Vrátil <dvratil@redhat.com>2012-06-27 20:18:38 +0800
commit255e0529040baae67e3d70f1030ce248fd61856d (patch)
tree9ac25ad9a737fc679b1c9b0e89b4441a6fbbebec /addressbook/gui
parentde86ffdd180f66c0727e189ededbd40fe8436bd7 (diff)
downloadgsoc2013-evolution-255e0529040baae67e3d70f1030ce248fd61856d.tar
gsoc2013-evolution-255e0529040baae67e3d70f1030ce248fd61856d.tar.gz
gsoc2013-evolution-255e0529040baae67e3d70f1030ce248fd61856d.tar.bz2
gsoc2013-evolution-255e0529040baae67e3d70f1030ce248fd61856d.tar.lz
gsoc2013-evolution-255e0529040baae67e3d70f1030ce248fd61856d.tar.xz
gsoc2013-evolution-255e0529040baae67e3d70f1030ce248fd61856d.tar.zst
gsoc2013-evolution-255e0529040baae67e3d70f1030ce248fd61856d.zip
Fix displaying photos in contacts preview
EContactPhoto URIs are already escaped, but WebKit escapes it again, so images are not displayed sometimes. Unescaping the URI before writing it to the HTML fixes to problem.
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/widgets/eab-contact-formatter.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/addressbook/gui/widgets/eab-contact-formatter.c b/addressbook/gui/widgets/eab-contact-formatter.c
index cc4988d5b3..43d68b163f 100644
--- a/addressbook/gui/widgets/eab-contact-formatter.c
+++ b/addressbook/gui/widgets/eab-contact-formatter.c
@@ -421,10 +421,11 @@ render_title_block (EABContactFormatter *formatter,
photo_data);
} else if (photo && photo->type == E_CONTACT_PHOTO_TYPE_URI && photo->data.uri && *photo->data.uri) {
gboolean is_local = g_str_has_prefix (photo->data.uri, "file://");
-
+ gchar *unescaped = g_uri_unescape_string (photo->data.uri, NULL);
g_string_append_printf (
buffer, "<img border=\"1\" src=\"%s%s\">",
- is_local ? "evo-" : "", photo->data.uri);
+ is_local ? "evo-" : "", unescaped);
+ g_free (unescaped);
}
if (photo)
@@ -878,11 +879,13 @@ render_compact (EABContactFormatter *formatter,
if (photo->type == E_CONTACT_PHOTO_TYPE_URI &&
photo->data.uri && *photo->data.uri) {
gboolean is_local = g_str_has_prefix (photo->data.uri, "file://");
+ gchar *unescaped = g_uri_unescape_string (photo->data.uri, NULL);
g_string_append_printf (
buffer,
"<img width=\"%d\" height=\"%d\" src=\"%s%s\">",
calced_width, calced_height,
- is_local ? "evo-" : "", photo->data.uri);
+ is_local ? "evo-" : "", unescaped);
+ g_free (unescaped);
} else {
gchar *photo_data;