aboutsummaryrefslogtreecommitdiffstats
path: root/embed/ephy-request-about.c
diff options
context:
space:
mode:
authorCarlos Garcia Campos <cgarcia@igalia.com>2012-05-29 20:30:49 +0800
committerCarlos Garcia Campos <carlosgc@gnome.org>2012-06-14 19:41:42 +0800
commit2b5cfe828cef29dd20225540fdd2bf5fcbf6b8fc (patch)
tree774eb65bf0e127118de737852843967d5e3d01f7 /embed/ephy-request-about.c
parent8e096384a3e15ba1b68235045c6148a8af29cedb (diff)
downloadgsoc2013-epiphany-2b5cfe828cef29dd20225540fdd2bf5fcbf6b8fc.tar.gz
gsoc2013-epiphany-2b5cfe828cef29dd20225540fdd2bf5fcbf6b8fc.tar.zst
gsoc2013-epiphany-2b5cfe828cef29dd20225540fdd2bf5fcbf6b8fc.zip
e-file-helpers: Add ephy_file_create_data_uri_for_filename()
It creates a data URI for the given filename. Use the new function when building error and applications pages. https://bugzilla.gnome.org/show_bug.cgi?id=677025
Diffstat (limited to 'embed/ephy-request-about.c')
-rw-r--r--embed/ephy-request-about.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/embed/ephy-request-about.c b/embed/ephy-request-about.c
index e239c1123..bfff22f95 100644
--- a/embed/ephy-request-about.c
+++ b/embed/ephy-request-about.c
@@ -182,19 +182,17 @@ ephy_request_about_send (SoupRequest *request,
applications = ephy_web_application_get_application_list ();
for (p = applications; p; p = p->next) {
- char *img_data = NULL, *img_data_base64 = NULL;
- gsize data_length;
+ char *icon_uri;
EphyWebApplication *app = (EphyWebApplication*)p->data;
-
- if (g_file_get_contents (app->icon_url, &img_data, &data_length, NULL))
- img_data_base64 = g_base64_encode ((guchar*)img_data, data_length);
- g_string_append_printf (data_str, "<tbody><tr><td class=\"icon\"><img width=64 height=64 src=\"data:image/png;base64,%s\">" \
+
+ icon_uri = ephy_file_create_data_uri_for_filename (app->icon_url, "image/png");
+ g_string_append_printf (data_str, "<tbody><tr><td class=\"icon\"><img width=64 height=64 src=\"%s\">" \
" </img></td><td class=\"data\"><div class=\"appname\">%s</div><div class=\"appurl\">%s</div></td><td class=\"input\"><input type=\"submit\" value=\"Delete\" id=\"%s\"></td><td class=\"date\">%s <br /> %s</td></tr>",
- img_data_base64, app->name, app->url, app->name,
+ icon_uri ? icon_uri : "",
+ app->name, app->url, app->name,
/* Note for translators: this refers to the installation date. */
_("Installed on:"), app->install_date);
- g_free (img_data_base64);
- g_free (img_data);
+ g_free (icon_uri);
}
g_string_append (data_str, "</form></table></body>");