fix glib resource API usage even when gresource was disabled

This commit is contained in:
Vincent Sanders 2015-06-29 15:48:08 +01:00
parent 796ac470b5
commit 1c5a5207fb

View File

@ -468,7 +468,9 @@ nsgdk_pixbuf_new_from_resname(const char *resname, GdkPixbuf **pixbuf_out)
break; break;
case NSGTK_RESOURCE_GLIB: case NSGTK_RESOURCE_GLIB:
#ifdef WITH_GRESOURCE
new_pixbuf = gdk_pixbuf_new_from_resource(resource->path, &error); new_pixbuf = gdk_pixbuf_new_from_resource(resource->path, &error);
#endif
break; break;
case NSGTK_RESOURCE_INLINE: case NSGTK_RESOURCE_INLINE:
@ -540,6 +542,7 @@ nsgtk_data_from_resname(const char *resname,
const uint8_t ** data_out, const uint8_t ** data_out,
size_t *data_size_out) size_t *data_size_out)
{ {
#ifdef WITH_GRESOURCE
struct nsgtk_resource_s *resource; struct nsgtk_resource_s *resource;
GBytes *data; GBytes *data;
const gchar *buffer; const gchar *buffer;
@ -564,6 +567,12 @@ nsgtk_data_from_resname(const char *resname,
*data_size_out = (size_t)buffer_length; *data_size_out = (size_t)buffer_length;
return NSERROR_OK; return NSERROR_OK;
#else
/** \todo consider adding compiled inline resources for things
* other than pixbufs.
*/
return NSERROR_NOT_FOUND;
#endif
} }
/* exported interface documented in gtk/resources.h */ /* exported interface documented in gtk/resources.h */