diff options
| author | Moritz Eberl <moritz@semiodesk.com> | 2016-04-27 07:29:21 +0000 |
|---|---|---|
| committer | Moritz Eberl <moritz@semiodesk.com> | 2016-04-27 07:29:21 +0000 |
| commit | b8136b3cdbb75028e9eb815e69b735695453d70f (patch) | |
| tree | 09a44c034b7255fc8ad121a7c0e864415db0065e /src/extension/system.cpp | |
| parent | Correct enumeration names. (diff) | |
| download | inkscape-b8136b3cdbb75028e9eb815e69b735695453d70f.tar.gz inkscape-b8136b3cdbb75028e9eb815e69b735695453d70f.zip | |
Fixed path resolution in plugin loader.
(bzr r14862.1.1)
Diffstat (limited to 'src/extension/system.cpp')
| -rw-r--r-- | src/extension/system.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/extension/system.cpp b/src/extension/system.cpp index 6b8e80d3c..3c623455a 100644 --- a/src/extension/system.cpp +++ b/src/extension/system.cpp @@ -47,7 +47,7 @@ namespace Extension { static void open_internal(Inkscape::Extension::Extension *in_plug, gpointer in_data); static void save_internal(Inkscape::Extension::Extension *in_plug, gpointer in_data); -static Extension *build_from_reprdoc(Inkscape::XML::Document *doc, Implementation::Implementation *in_imp); +static Extension *build_from_reprdoc(Inkscape::XML::Document *doc, Implementation::Implementation *in_imp, std::string* baseDir); /** * \return A new document created from the filename passed in @@ -422,7 +422,7 @@ get_print(gchar const *key) * case could apply to modules that are built in (like the SVG load/save functions). */ static Extension * -build_from_reprdoc(Inkscape::XML::Document *doc, Implementation::Implementation *in_imp) +build_from_reprdoc(Inkscape::XML::Document *doc, Implementation::Implementation *in_imp, std::string* baseDir) { enum { MODULE_EXTENSION, @@ -490,7 +490,9 @@ build_from_reprdoc(Inkscape::XML::Document *doc, Implementation::Implementation } case MODULE_PLUGIN: { Inkscape::Extension::Loader loader = Inkscape::Extension::Loader(); - loader.set_base_directory ( Inkscape::Application::profile_path("extensions")); + if( baseDir != NULL){ + loader.set_base_directory ( *baseDir ); + } imp = loader.load_implementation(doc); break; } @@ -546,7 +548,8 @@ Extension * build_from_file(gchar const *filename) { Inkscape::XML::Document *doc = sp_repr_read_file(filename, INKSCAPE_EXTENSION_URI); - Extension *ext = build_from_reprdoc(doc, NULL); + std::string dir = Glib::path_get_dirname(filename); + Extension *ext = build_from_reprdoc(doc, NULL, &dir); if (ext != NULL) Inkscape::GC::release(doc); else @@ -568,7 +571,7 @@ build_from_mem(gchar const *buffer, Implementation::Implementation *in_imp) { Inkscape::XML::Document *doc = sp_repr_read_mem(buffer, strlen(buffer), INKSCAPE_EXTENSION_URI); g_return_val_if_fail(doc != NULL, NULL); - Extension *ext = build_from_reprdoc(doc, in_imp); + Extension *ext = build_from_reprdoc(doc, in_imp, NULL); Inkscape::GC::release(doc); return ext; } |
