# HG changeset patch # User Teemu Piippo # Date 1410025258 -10800 # Node ID c5b3bc08e609c692acd8979b608f48d38d351cb2 # Parent 945e44575b3e73d6233bb3a39fa030ca0651151b - if an external program fails to run properly, an stdout&stderr log is now printed - fixed: external program commandlines got botched up due to bad default argument in Join() diff -r 945e44575b3e -r c5b3bc08e609 src/editHistory.cc --- a/src/editHistory.cc Sat Sep 06 15:45:07 2014 +0300 +++ b/src/editHistory.cc Sat Sep 06 20:40:58 2014 +0300 @@ -105,7 +105,7 @@ m_changesets.removeLast(); } - dprint ("History: step added (%1 changes)", m_currentChangeset.size()); +// dprint ("History: step added (%1 changes)", m_currentChangeset.size()); m_changesets << m_currentChangeset; m_currentChangeset.clear(); setPosition (position() + 1); @@ -124,7 +124,7 @@ entry->setParent (this); m_currentChangeset << entry; - dprint ("History: added entry of type %1", entry->getTypeName()); +// dprint ("History: added entry of type %1", entry->getTypeName()); } // ============================================================================= @@ -200,4 +200,4 @@ void SwapHistory::redo() const { undo(); -} \ No newline at end of file +} diff -r 945e44575b3e -r c5b3bc08e609 src/extPrograms.cc --- a/src/extPrograms.cc Sat Sep 06 15:45:07 2014 +0300 +++ b/src/extPrograms.cc Sat Sep 06 20:40:58 2014 +0300 @@ -24,6 +24,7 @@ #include #include #include +#include #include "main.h" #include "configuration.h" #include "miscallenous.h" @@ -280,6 +281,20 @@ if (not err.isEmpty()) { CriticalError (format ("%1 failed: %2\n", g_extProgNames[prog], err)); + + QString filename ("externalProgramOutput.txt"); + QFile file (filename); + if (file.open (QIODevice::WriteOnly | QIODevice::Text)) + { + file.write (proc.readAllStandardOutput()); + file.write (proc.readAllStandardError()); + print ("Wrote output and error logs to %1", QFileInfo (file).absoluteFilePath()); + } + else + { + print ("Couldn't open %1 for writing: %2", + QFileInfo (filename).absoluteFilePath(), file.errorString()); + } return false; } diff -r 945e44575b3e -r c5b3bc08e609 src/miscallenous.h --- a/src/miscallenous.h Sat Sep 06 15:45:07 2014 +0300 +++ b/src/miscallenous.h Sat Sep 06 20:40:58 2014 +0300 @@ -40,7 +40,7 @@ double GetCoordinateOf (const Vertex& a, Axis ax); QString MakePrettyFileSize (qint64 size); -QString Join (QList vals, QString delim = ""); +QString Join (QList vals, QString delim = " "); // Grid stuff struct GridData