src/extPrograms.cc

changeset 880
5dcd2e741d1c
parent 879
c5b3bc08e609
child 882
2f3cc8e045d5
equal deleted inserted replaced
879:c5b3bc08e609 880:5dcd2e741d1c
279 err = format ("Program exited abnormally (return code %1).", proc.exitCode()); 279 err = format ("Program exited abnormally (return code %1).", proc.exitCode());
280 280
281 if (not err.isEmpty()) 281 if (not err.isEmpty())
282 { 282 {
283 CriticalError (format ("%1 failed: %2\n", g_extProgNames[prog], err)); 283 CriticalError (format ("%1 failed: %2\n", g_extProgNames[prog], err));
284
285 QString filename ("externalProgramOutput.txt"); 284 QString filename ("externalProgramOutput.txt");
286 QFile file (filename); 285 QFile file (filename);
286
287 if (file.open (QIODevice::WriteOnly | QIODevice::Text)) 287 if (file.open (QIODevice::WriteOnly | QIODevice::Text))
288 { 288 {
289 file.write (proc.readAllStandardOutput()); 289 file.write (proc.readAllStandardOutput());
290 file.write (proc.readAllStandardError()); 290 file.write (proc.readAllStandardError());
291 print ("Wrote output and error logs to %1", QFileInfo (file).absoluteFilePath()); 291 print ("Wrote output and error logs to %1", QFileInfo (file).absoluteFilePath());
293 else 293 else
294 { 294 {
295 print ("Couldn't open %1 for writing: %2", 295 print ("Couldn't open %1 for writing: %2",
296 QFileInfo (filename).absoluteFilePath(), file.errorString()); 296 QFileInfo (filename).absoluteFilePath(), file.errorString());
297 } 297 }
298
298 return false; 299 return false;
299 } 300 }
300 301
301 return true; 302 return true;
302 } 303 }

mercurial