diff options
| author | Martin Owens <doctormo@gmail.com> | 2017-07-02 14:47:03 +0000 |
|---|---|---|
| committer | Martin Owens <doctormo@gmail.com> | 2017-07-02 14:47:03 +0000 |
| commit | 7dc5626af3eb924fa381c46491cd49178a78cd73 (patch) | |
| tree | e50a3b98ce1393b7a06efbd11425f8c458b0cbbb /src/extension/implementation/script.cpp | |
| parent | pyc files are generated when testing modules, ignore them (diff) | |
| download | inkscape-7dc5626af3eb924fa381c46491cd49178a78cd73.tar.gz inkscape-7dc5626af3eb924fa381c46491cd49178a78cd73.zip | |
Move directory scanners to new get_filenames(...) calls
Diffstat (limited to 'src/extension/implementation/script.cpp')
| -rw-r--r-- | src/extension/implementation/script.cpp | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index b1058d415..8da56fecd 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -33,6 +33,7 @@ #include "extension/db.h" #include "inkscape.h" #include "io/sys.h" +#include "io/resource.h" #include "preferences.h" #include "script.h" #include "selection.h" @@ -184,25 +185,8 @@ std::string Script::solve_reldir(Inkscape::XML::Node *reprin) { Glib::ustring str = reprin->firstChild()->content(); return str; } - - Glib::ustring reldir = s; - 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); - //printf("Filename: %s\n", filename.c_str()); - if ( Inkscape::IO::file_test(filename.c_str(), G_FILE_TEST_EXISTS) ) { - return Glib::filename_from_utf8(filename); - } - } - - return ""; + using namespace Inkscape::IO::Resource; + return get_filename(EXTENSIONS, reprin->firstChild()->content()); } |
