summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-06-29 14:11:26 (GMT)
committer Vincent Sanders <vince@kyllikki.org>2015-06-29 14:11:26 (GMT)
commit796ac470b5e86e185ebfcd9b5d3f1a8686b7662f (patch)
tree0241e3af9d9056e5b169b690739a809d9171f6f1 /gtk
parent822e3a8fd05466df1ddd9450374e8d0aaeb7f272 (diff)
downloadnetsurf-796ac470b5e86e185ebfcd9b5d3f1a8686b7662f.tar.gz
netsurf-796ac470b5e86e185ebfcd9b5d3f1a8686b7662f.tar.bz2
Improve resource code to not try and use g_resource calls when disabled.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/resources.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gtk/resources.c b/gtk/resources.c
index 0c8c192..b90fdd4 100644
--- a/gtk/resources.c
+++ b/gtk/resources.c
@@ -256,12 +256,15 @@ static nserror
init_direct_resource(char **respath, struct nsgtk_resource_s *resource)
{
nserror res;
- GBytes *data;
res = init_resource(respath, resource);
+
+#ifdef WITH_GRESOURCE
if ((res == NSERROR_OK) &&
(resource->type == NSGTK_RESOURCE_GLIB)) {
/* found gresource we can convert */
+ GBytes *data;
+
data = g_resources_lookup_data(resource->path,
G_RESOURCE_LOOKUP_FLAGS_NONE,
NULL);
@@ -270,6 +273,7 @@ init_direct_resource(char **respath, struct nsgtk_resource_s *resource)
resource->path = (char *)data;
}
}
+#endif
return res;
}