projects
/
claws.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
cdf48fc
)
Load SVG files the deprecated way
author
Ricardo Mones
<ricardo@mones.org>
Sat, 28 Jan 2017 20:29:30 +0000
(21:29 +0100)
committer
Ricardo Mones
<ricardo@mones.org>
Tue, 7 Feb 2017 19:02:58 +0000
(20:02 +0100)
src/stock_pixmap.c
patch
|
blob
|
history
diff --git
a/src/stock_pixmap.c
b/src/stock_pixmap.c
index b401fa7aa09508078679dbec4cf0a7c5ca957cac..947b2e6088de8f4f900b96b3db904ba4c36af531 100644
(file)
--- a/
src/stock_pixmap.c
+++ b/
src/stock_pixmap.c
@@
-23,6
+23,7
@@
#include <glib.h>
#include <gtk/gtk.h>
#include <glib.h>
#include <gtk/gtk.h>
+#include <librsvg/rsvg.h>
#include <string.h>
#include <dirent.h>
#include <string.h>
#include <dirent.h>
@@
-468,6
+469,9
@@
static StockPixmapData pixmaps[] =
static const char *extension[] = {
".png",
".xpm",
static const char *extension[] = {
".png",
".xpm",
+#ifdef HAVE_SVG
+ ".svg",
+#endif
NULL
};
NULL
};
@@
-526,7
+530,15
@@
try_next_extension:
NULL);
if (is_file_exist(icon_file_name)) {
GError *err = NULL;
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);
pix = gdk_pixbuf_new_from_file(icon_file_name, &err);
+#endif
if (err) g_error_free(err);
}
if (pix) {
if (err) g_error_free(err);
}
if (pix) {