diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2016-05-02 19:08:15 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marcjeanmougin@free.fr> | 2016-05-02 19:08:15 +0000 |
| commit | eb5847cd8a8460b123b33f07c9270a1b5e3b114c (patch) | |
| tree | 42a8fd6854e8c5f10d10fbb90d0231a858306722 /src/extension/system.cpp | |
| parent | Translations. Italian translation update. (diff) | |
| parent | Fixed "make install" to set the right rpath. libinkscape_base.so should now b... (diff) | |
| download | inkscape-eb5847cd8a8460b123b33f07c9270a1b5e3b114c.tar.gz inkscape-eb5847cd8a8460b123b33f07c9270a1b5e3b114c.zip | |
Merge ~meberl/inkscape/extension-fixes + CMake build: install libs and links installed bin to installed libs.
(bzr r14866)
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; } |
