From 380c3467b2136e6bbc0b23d05829a75d858a3ffe Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Wed, 6 Oct 2010 20:58:55 +0200 Subject: Extensions. Fix for Bug #652943 (Aborted output extensions create an empty file). Fixed bugs: - https://launchpad.net/bugs/652943 (bzr r9815) --- src/extension/implementation/script.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/extension/implementation/script.cpp') diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index e075feb91..9a461ab2d 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -602,10 +602,14 @@ void Script::save(Inkscape::Extension::Output *module, file_listener fileout; - execute(command, params, tempfilename_in, fileout); + int data_read = execute(command, params, tempfilename_in, fileout); + + bool success = false; - std::string lfilename = Glib::filename_from_utf8(filenameArg); - bool success = fileout.toFile(lfilename); + if (data_read > 0) { + std::string lfilename = Glib::filename_from_utf8(filenameArg); + success = fileout.toFile(lfilename); + } // make sure we don't leak file descriptors from g_file_open_tmp close(tempfd_in); -- cgit v1.2.3 From be8029ed57d68a7b8e94cfc5b82984a8b1c75e55 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Tue, 12 Oct 2010 22:06:35 +0200 Subject: Remove the failed and unused "new gui" stuff. (bzr r9828) --- src/extension/implementation/script.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/extension/implementation/script.cpp') diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index 9a461ab2d..4fe0b5849 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -39,7 +39,7 @@ #include "extension/db.h" #include "script.h" #include "dialogs/dialog-events.h" -#include "application/application.h" +#include "inkscape.h" #include "xml/node.h" #include "xml/attribute-record.h" @@ -983,7 +983,7 @@ int Script::execute (const std::list &in_command, Glib::ustring stderr_data = fileerr.string(); if (stderr_data.length() != 0 && - Inkscape::NSApplication::Application::getUseGui() + inkscape_use_gui() ) { checkStderr(stderr_data, Gtk::MESSAGE_INFO, _("Inkscape has received additional data from the script executed. " -- cgit v1.2.3 From 144819c918dc761641c3cb5a490205fb73194ee3 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Wed, 17 Nov 2010 13:12:56 +1100 Subject: Super duper mega (fun!) commit: replaced encoding=utf-8 with fileencoding=utf-8 in all 1074 Vim modelines. The reason for this is that (a) setting the encoding isn't nice, and (b) Vim 7.3 (with modeline enabled) disallows it and pops up an error whenever you open any file with it ("invalid modeline"). Also corrected five deviant modestrings: * src/ui/widget/dock.cpp and src/ui/widget/dock.h: missing colon at the end * src/ui/dialog/tile.cpp: removed gratuitous second colon at the end * src/helper/units-test.h: removed gratuitous space before a colon * share/extensions/export_gimp_palette.py: missing textwidth=99 That's my geekiest commit yet. (bzr r9900) --- 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 4fe0b5849..04c7c15a6 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -1015,4 +1015,4 @@ int Script::execute (const std::list &in_command, fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : -- cgit v1.2.3