From 68a87c54e8134effdb8169d895d434441d3b2299 Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Mon, 31 Jan 2011 17:48:10 +0100 Subject: Extensions. Fix for Bug #668895 (Extensions with tags fail to load). (bzr r10020) --- src/extension/implementation/script.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/extension/implementation/script.cpp') diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index bc143fd14..428ee626f 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -236,7 +236,7 @@ bool Script::check_existence(const std::string &command) } //Don't search when it is an absolute path. */ - if (!Glib::path_is_absolute(command)) { + if (Glib::path_is_absolute(command)) { if (Glib::file_test(command, Glib::FILE_TEST_EXISTS)) { return true; } else { -- cgit v1.2.3 From 0f535660ee7c8ba0a6befb9066a9f97168e034db Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Wed, 2 Feb 2011 18:26:59 +0100 Subject: Extensions. Check element now search in the extension directory (see Bug #668895, Extensions with tags fail to load). (bzr r10023) --- src/extension/implementation/script.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/extension/implementation/script.cpp') diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index 428ee626f..0f234c7d4 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -45,7 +45,7 @@ #include "xml/attribute-record.h" #include "util/glib-list-iterators.h" - +#include "path-prefix.h" #ifdef WIN32 @@ -229,7 +229,6 @@ Script::solve_reldir(Inkscape::XML::Node *reprin) { */ bool Script::check_existence(const std::string &command) { - // Check the simple case first if (command.empty()) { return false; @@ -243,13 +242,14 @@ bool Script::check_existence(const std::string &command) return false; } } - - std::string path = Glib::getenv("PATH"); - if (path.empty()) { - /* There is no `PATH' in the environment. - The default search path is the current directory */ - path = G_SEARCHPATH_SEPARATOR_S; - } + + // First search in the extension path and the current directory + std::string path = INKSCAPE_EXTENSIONDIR; + path.append(";"); + path.append(G_SEARCHPATH_SEPARATOR_S); + path.append(";"); + // And then the PATH environment variable. + path.append(Glib::getenv("PATH")); std::string::size_type pos = 0; std::string::size_type pos2 = 0; -- cgit v1.2.3 From 2dd7659790b8dcd3fbb77d80fd15450f5be08c32 Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Wed, 9 Feb 2011 19:48:47 +0100 Subject: Extensions. New fix for Bug #668895 (Extensions with tags fail to load). (bzr r10038) --- src/extension/implementation/script.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/extension/implementation/script.cpp') diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index 0f234c7d4..cc54194ec 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -189,7 +189,6 @@ Script::solve_reldir(Inkscape::XML::Node *reprin) { } Glib::ustring reldir = s; - for (unsigned int i=0; i < Inkscape::Extension::Extension::search_path.size(); i++) { @@ -200,7 +199,7 @@ Script::solve_reldir(Inkscape::XML::Node *reprin) { 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); } @@ -242,13 +241,11 @@ bool Script::check_existence(const std::string &command) return false; } } - - // First search in the extension path and the current directory - std::string path = INKSCAPE_EXTENSIONDIR; - path.append(";"); - path.append(G_SEARCHPATH_SEPARATOR_S); + + // First search in the current directory + std::string path = G_SEARCHPATH_SEPARATOR_S; path.append(";"); - // And then the PATH environment variable. + // And then in the PATH environment variable. path.append(Glib::getenv("PATH")); std::string::size_type pos = 0; @@ -379,8 +376,11 @@ Script::check(Inkscape::Extension::Extension *module) if (!command_text.empty()) { /* I've got the command */ bool existance = check_existence(command_text); - if (!existance) + if (!existance) { return false; + } + } else { + return false; } } -- cgit v1.2.3 From db451544150359dab56c14150a58f58ec76798b4 Mon Sep 17 00:00:00 2001 From: Adib Taraben Date: Tue, 15 Feb 2011 00:36:45 +0100 Subject: preview dialogue for pdf-import-cairo (bzr r10049.1.1) --- src/extension/implementation/script.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/extension/implementation/script.cpp') diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index cc54194ec..2f3e2cd65 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -603,7 +603,7 @@ void Script::save(Inkscape::Extension::Output *module, file_listener fileout; int data_read = execute(command, params, tempfilename_in, fileout); - + bool success = false; if (data_read > 0) { -- cgit v1.2.3