diff options
| author | Patrick Storz <eduard.braun2@gmx.de> | 2019-10-14 18:58:58 +0000 |
|---|---|---|
| committer | Patrick Storz <eduard.braun2@gmx.de> | 2019-10-14 18:58:58 +0000 |
| commit | 19463b12ec3527406825b9d2e092d6e78688f2a4 (patch) | |
| tree | 59008ee44a4138ff35c218bed89a2ad38748376a /src/extension/implementation/xslt.cpp | |
| parent | Extensions: Improve logic to lookup script extensions (diff) | |
| download | inkscape-19463b12ec3527406825b9d2e092d6e78688f2a4.tar.gz inkscape-19463b12ec3527406825b9d2e092d6e78688f2a4.zip | |
Extensions: Switch .xslt file look-up to dependency logic as well
Diffstat (limited to 'src/extension/implementation/xslt.cpp')
| -rw-r--r-- | src/extension/implementation/xslt.cpp | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/src/extension/implementation/xslt.cpp b/src/extension/implementation/xslt.cpp index 69e876be4..81ce90dd0 100644 --- a/src/extension/implementation/xslt.cpp +++ b/src/extension/implementation/xslt.cpp @@ -57,25 +57,6 @@ XSLT::XSLT() : { } -Glib::ustring XSLT::solve_reldir(Inkscape::XML::Node *reprin) { - - gchar const *s = reprin->attribute("reldir"); - - if (!s) { - Glib::ustring str = reprin->firstChild()->content(); - return str; - } - - Glib::ustring reldir = s; - if (reldir == "extensions") { - using namespace Inkscape::IO::Resource; - return get_filename(EXTENSIONS, reprin->firstChild()->content()); - } else { - Glib::ustring str = reprin->firstChild()->content(); - return str; - } -} - bool XSLT::check(Inkscape::Extension::Extension *module) { if (load(module)) { @@ -96,7 +77,10 @@ bool XSLT::load(Inkscape::Extension::Extension *module) child_repr = child_repr->firstChild(); while (child_repr != nullptr) { if (!strcmp(child_repr->name(), INKSCAPE_EXTENSION_NS "file")) { - _filename = solve_reldir(child_repr); + // TODO: we already parse xslt files as dependencies in extension.cpp + // can can we optimize this to be less indirect? + const char *filename = child_repr->firstChild()->content(); + _filename = module->get_dependency_location(filename); } child_repr = child_repr->next(); } |
