forked from qt-creator/qt-creator
Use QtcProcess in FormatTask
Change-Id: Ifd46259fc4e8b68342315a227748f2ecb9acc9d6 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -113,19 +113,19 @@ static FormatTask format(FormatTask task)
|
||||
return task;
|
||||
|
||||
case Command::PipeProcessing: {
|
||||
QProcess process;
|
||||
QtcProcess process;
|
||||
QStringList options = task.command.options();
|
||||
options.replaceInStrings("%filename", QFileInfo(task.filePath).fileName());
|
||||
options.replaceInStrings("%file", task.filePath);
|
||||
process.start(executable, options);
|
||||
process.setCommand({FilePath::fromString(executable), options});
|
||||
process.setWriteData(task.sourceData.toUtf8());
|
||||
process.start();
|
||||
if (!process.waitForStarted(3000)) {
|
||||
task.error = QString(QT_TRANSLATE_NOOP("TextEditor",
|
||||
"Cannot call %1 or some other error occurred."))
|
||||
.arg(executable);
|
||||
return task;
|
||||
}
|
||||
process.write(task.sourceData.toUtf8());
|
||||
process.closeWriteChannel();
|
||||
if (!process.waitForFinished(5000)) {
|
||||
process.kill();
|
||||
task.error = QString(QT_TRANSLATE_NOOP("TextEditor",
|
||||
|
Reference in New Issue
Block a user