talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit db434c2b05aec33ca6c3cc4fda792d40cf34942c
parent cdf48fc3e9ce71ef09c0b9ddbdf7057f6d36e6da
Author: Ricardo Mones <ricardo@mones.org>
Date:   Sat, 28 Jan 2017 21:29:30 +0100

Load SVG files the deprecated way

Diffstat:
Msrc/stock_pixmap.c | 12++++++++++++
1 file changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/stock_pixmap.c b/src/stock_pixmap.c @@ -23,6 +23,7 @@ #include <glib.h> #include <gtk/gtk.h> +#include <librsvg/rsvg.h> #include <string.h> #include <dirent.h> @@ -468,6 +469,9 @@ static StockPixmapData pixmaps[] = static const char *extension[] = { ".png", ".xpm", +#ifdef HAVE_SVG + ".svg", +#endif NULL }; @@ -526,7 +530,15 @@ try_next_extension: NULL); if (is_file_exist(icon_file_name)) { GError *err = NULL; +#ifdef HAVE_SVG + if (!strncmp(extension[i], ".svg", 4)) { + pix = rsvg_pixbuf_from_file(icon_file_name, &err); + } else { + pix = gdk_pixbuf_new_from_file(icon_file_name, &err); + } +#else pix = gdk_pixbuf_new_from_file(icon_file_name, &err); +#endif if (err) g_error_free(err); } if (pix) {