From 7dc5626af3eb924fa381c46491cd49178a78cd73 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Sun, 2 Jul 2017 16:47:03 +0200 Subject: Move directory scanners to new get_filenames(...) calls --- src/extension/implementation/xslt.cpp | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'src/extension/implementation/xslt.cpp') diff --git a/src/extension/implementation/xslt.cpp b/src/extension/implementation/xslt.cpp index 373378d97..94852a98e 100644 --- a/src/extension/implementation/xslt.cpp +++ b/src/extension/implementation/xslt.cpp @@ -23,6 +23,7 @@ #include "extension/input.h" #include "io/sys.h" +#include "io/resource.h" #include #include #include "document.h" @@ -62,30 +63,13 @@ Glib::ustring XSLT::solve_reldir(Inkscape::XML::Node *reprin) { } Glib::ustring reldir = s; - if (reldir == "extensions") { - - for (unsigned int i=0; - i < Inkscape::Extension::Extension::search_path.size(); - i++) { - - gchar * fname = g_build_filename( - Inkscape::Extension::Extension::search_path[i], - reprin->firstChild()->content(), - NULL); - Glib::ustring filename = fname; - g_free(fname); - - if ( Inkscape::IO::file_test(filename.c_str(), G_FILE_TEST_EXISTS) ) - return filename; - - } + using namespace Inkscape::IO::Resource; + return get_filename(EXTENSIONS, reprin->firstChild()->content()); } else { Glib::ustring str = reprin->firstChild()->content(); return str; } - - return ""; } bool XSLT::check(Inkscape::Extension::Extension *module) -- cgit v1.2.3