- status = svg_cairo_parse (icon->svg_cairo, file);
- if (status == SVG_CAIRO_STATUS_SUCCESS) {
- free (file);
- return RR_STATUS_SUCCESS;
- }
- fprintf (stderr, "Error parsing SVG icon: %s\n", file);
- free (file);
- }
-
- _grr_icon_find_buffer (name, &buf, &buflen);
- status = svg_cairo_parse_buffer (icon->svg_cairo, buf, buflen);
- if (status) {
- fprintf (stderr, "Error parsing built-in SVG icon for: %s\n", name);
- return RR_STATUS_PARSE_ERROR;
+ icon->rsvg = rsvg_handle_new_from_file(file, &error);
+ if (!icon->rsvg) {
+ fprintf (stderr, "Error parsing SVG icon: %s\n", file);
+ return RR_STATUS_PARSE_ERROR;
+ }
+ } else {
+ _grr_icon_find_buffer (name, &buf, &buflen);
+ icon->rsvg = rsvg_handle_new_from_data(buf, buflen, &error);
+ if (!icon->rsvg) {
+ fprintf (stderr, "Error parsing built-in SVG icon for: %s\n", name);
+ return RR_STATUS_PARSE_ERROR;
+ }