193 // Write the input file |
193 // Write the input file |
194 QFile f (fname); |
194 QFile f (fname); |
195 |
195 |
196 if (not f.open (QIODevice::WriteOnly | QIODevice::Text)) |
196 if (not f.open (QIODevice::WriteOnly | QIODevice::Text)) |
197 { |
197 { |
198 CriticalError (format ("Couldn't open temporary file %1 for writing: %2\n", fname, f.errorString())); |
198 Critical (format ("Couldn't open temporary file %1 for writing: %2\n", fname, f.errorString())); |
199 return; |
199 return; |
200 } |
200 } |
201 |
201 |
202 WriteObjects (objects, f); |
202 WriteObjects (objects, f); |
203 f.close(); |
203 f.close(); |
257 proc.setStandardInputFile (input.fileName()); |
257 proc.setStandardInputFile (input.fileName()); |
258 proc.start (path, argv); |
258 proc.start (path, argv); |
259 |
259 |
260 if (not proc.waitForStarted()) |
260 if (not proc.waitForStarted()) |
261 { |
261 { |
262 CriticalError (format ("Couldn't start %1: %2\n", g_extProgNames[prog], ProcessExtProgError (prog, proc))); |
262 Critical (format ("Couldn't start %1: %2\n", g_extProgNames[prog], ProcessExtProgError (prog, proc))); |
263 return false; |
263 return false; |
264 } |
264 } |
265 |
265 |
266 // Write an enter, the utility tools all expect one |
266 // Write an enter, the utility tools all expect one |
267 input.write ("\n"); |
267 input.write ("\n"); |
278 if (proc.exitCode() != 0) |
278 if (proc.exitCode() != 0) |
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 Critical (format ("%1 failed: %2\n", g_extProgNames[prog], err)); |
284 QString filename ("externalProgramOutput.txt"); |
284 QString filename ("externalProgramOutput.txt"); |
285 QFile file (filename); |
285 QFile file (filename); |
286 |
286 |
287 if (file.open (QIODevice::WriteOnly | QIODevice::Text)) |
287 if (file.open (QIODevice::WriteOnly | QIODevice::Text)) |
288 { |
288 { |
313 // Read the output file |
313 // Read the output file |
314 QFile f (fname); |
314 QFile f (fname); |
315 |
315 |
316 if (not f.open (QIODevice::ReadOnly)) |
316 if (not f.open (QIODevice::ReadOnly)) |
317 { |
317 { |
318 CriticalError (format ("Couldn't open temporary file %1 for reading.\n", fname)); |
318 Critical (format ("Couldn't open temporary file %1 for reading.\n", fname)); |
319 return; |
319 return; |
320 } |
320 } |
321 |
321 |
322 LDObjectList objs = LoadFileContents (&f, null); |
322 LDObjectList objs = LoadFileContents (&f, null); |
323 |
323 |