From 1b772dcb279678d8760dbbfd3c6ff24dc06ec135 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 3 Nov 2021 17:34:40 +0100 Subject: [PATCH] Use QtcProcess in FormatTask Change-Id: Ifd46259fc4e8b68342315a227748f2ecb9acc9d6 Reviewed-by: hjk Reviewed-by: David Schulz --- src/plugins/texteditor/formattexteditor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/texteditor/formattexteditor.cpp b/src/plugins/texteditor/formattexteditor.cpp index c06fe1aee2f..830a8e8a992 100644 --- a/src/plugins/texteditor/formattexteditor.cpp +++ b/src/plugins/texteditor/formattexteditor.cpp @@ -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",