X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fextension%2Fimplementation%2Fscript.cpp;h=5975d6d24934d678f8aeaaf500e6e1a97a547fc5;hb=ac248d5f76a334cd01269ef995c00dba1ba28ed8;hp=ae3c243ce968b7a449a961f132b45bf6f45a7088;hpb=fd11dc4a0286462a4e89efa56bcc2efb22faca4d;p=inkscape.git diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index ae3c243ce..5975d6d24 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -27,7 +27,6 @@ #include "selection.h" #include "sp-namedview.h" #include "io/sys.h" -#include "registrytool.h" #include "prefs-utils.h" #include "../system.h" #include "extension/effect.h" @@ -42,6 +41,7 @@ #ifdef WIN32 #include #include +#include "registrytool.h" #endif @@ -127,7 +127,7 @@ resolveInterpreterExecutable(const Glib::ustring &interpNameArg) if (stat(interpPath .c_str(), &finfo) ==0) { g_message("Found local interpreter, '%s', Size: %d", interpPath .c_str(), - finfo.st_size); + (int)finfo.st_size); return interpPath; } } @@ -441,7 +441,7 @@ Script::check(Inkscape::Extension::Extension *module) */ Gtk::Widget * Script::prefs_input(Inkscape::Extension::Input *module, - const Glib::ustring &filename) + const gchar *filename) { /*return module->autogui(); */ return NULL; @@ -514,9 +514,11 @@ Script::prefs_effect(Inkscape::Extension::Effect *module, */ SPDocument * Script::open(Inkscape::Extension::Input *module, - const Glib::ustring &filename) + const gchar *filenameArg) { + Glib::ustring filename = filenameArg; + gchar *tmpname; // FIXME: process the GError instead of passing NULL @@ -604,9 +606,11 @@ Script::open(Inkscape::Extension::Input *module, void Script::save(Inkscape::Extension::Output *module, SPDocument *doc, - const Glib::ustring &filename) + const gchar *filenameArg) { + Glib::ustring filename = filenameArg; + gchar *tmpname; // FIXME: process the GError instead of passing NULL gint tempfd = g_file_open_tmp("ink_ext_XXXXXX", &tmpname, NULL); @@ -814,8 +818,6 @@ Script::copy_doc (Inkscape::XML::Node * oldroot, Inkscape::XML::Node * newroot) child = child->next()) { if (!strcmp("sodipodi:namedview", child->name())) continue; - if (!strcmp("svg:defs", child->name())) - continue; delete_list.push_back(child); } for (unsigned int i = 0; i < delete_list.size(); i++) @@ -826,8 +828,6 @@ Script::copy_doc (Inkscape::XML::Node * oldroot, Inkscape::XML::Node * newroot) child = child->next()) { if (!strcmp("sodipodi:namedview", child->name())) continue; - if (!strcmp("svg:defs", child->name())) - continue; oldroot->appendChild(child->duplicate()); } @@ -985,7 +985,7 @@ Script::execute (const Glib::ustring &in_command, } else if (errno == ECHILD) { perror("Extension::Script: Could not obtain child status for pclose\n"); } else { - if (errorFile != NULL) { + if (!errorFile.empty()) { checkStderr(errorFile, Gtk::MESSAGE_ERROR, _("Inkscape has received an error from the script that it called. " "The text returned with the error is included below. " @@ -1190,10 +1190,10 @@ bool pipe_t::open(const Glib::ustring &command, Glib::ustring popen_mode; if ( (mode_p & mode_read) != 0 ) - popen_mode_cur.append("r"); + popen_mode.append("r"); if ( (mode_p & mode_write) != 0 ) - popen_mode_cur.append("w"); + popen_mode.append("w"); // Get the commandline to be run Glib::ustring pipeStr = command;