EABContactFormatter: Remove obsolete WebKitGTK code
The URI unescape is not needed to be done now (with WebKitGTK 2.28 and 2.30), just the opposite, it breaks image rendering in some cases, thus remove the code.
This commit is contained in:
@ -558,17 +558,10 @@ render_title_block (EABContactFormatter *formatter,
|
||||
} 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://");
|
||||
const gchar *uri = photo->data.uri;
|
||||
/* WebKit 2.2.x doesn't re-escape URIs, thus do this for versions before and after this */
|
||||
#if !(WEBKIT_MAJOR_VERSION == 2 && WEBKIT_MINOR_VERSION == 2)
|
||||
gchar *unescaped = g_uri_unescape_string (uri, NULL);
|
||||
uri = unescaped;
|
||||
#endif
|
||||
|
||||
g_string_append_printf (
|
||||
buffer, "<img id=\"__evo-contact-photo\" border=\"1\" src=\"%s%s\">",
|
||||
is_local ? "evo-" : "", uri);
|
||||
#if !(WEBKIT_MAJOR_VERSION == 2 && WEBKIT_MINOR_VERSION == 2)
|
||||
g_free (unescaped);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (photo)
|
||||
@ -1242,19 +1235,12 @@ render_compact (EABContactFormatter *formatter,
|
||||
photo->data.uri && *photo->data.uri) {
|
||||
gboolean is_local = g_str_has_prefix (photo->data.uri, "file://");
|
||||
const gchar *uri = photo->data.uri;
|
||||
/* WebKit 2.2.x doesn't re-escape URIs, thus do this for versions before and after this */
|
||||
#if !(WEBKIT_MAJOR_VERSION == 2 && WEBKIT_MINOR_VERSION == 2)
|
||||
gchar *unescaped = g_uri_unescape_string (uri, NULL);
|
||||
uri = unescaped;
|
||||
#endif
|
||||
|
||||
g_string_append_printf (
|
||||
buffer,
|
||||
"<img id=\"__evo-contact-photo\" width=\"%dpx\" height=\"%dpx\" src=\"%s%s\">",
|
||||
calced_width, calced_height,
|
||||
is_local ? "evo-" : "", uri);
|
||||
#if !(WEBKIT_MAJOR_VERSION == 2 && WEBKIT_MINOR_VERSION == 2)
|
||||
g_free (unescaped);
|
||||
#endif
|
||||
} else {
|
||||
gchar *photo_data;
|
||||
|
||||
|
Reference in New Issue
Block a user