[evolution/gnome-3-38] EABContactFormatter: Remove obsolete WebKitGTK code



commit b8e9908bd4657586a5bc36187af36e1f70a78b60
Author: Milan Crha <mcrha redhat com>
Date:   Thu Jan 7 12:30:23 2021 +0100

    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.

 src/addressbook/gui/widgets/eab-contact-formatter.c | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)
---
diff --git a/src/addressbook/gui/widgets/eab-contact-formatter.c 
b/src/addressbook/gui/widgets/eab-contact-formatter.c
index 197068a306..c4755e3ea4 100644
--- a/src/addressbook/gui/widgets/eab-contact-formatter.c
+++ b/src/addressbook/gui/widgets/eab-contact-formatter.c
@@ -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;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]