Improve resource code to not try and use g_resource calls when disabled.

This commit is contained in:
Vincent Sanders 2015-06-29 15:11:26 +01:00
parent 822e3a8fd0
commit 796ac470b5

View File

@ -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;
}