forked from qt-creator/qt-creator
Utils: Add CommandLine convenience constructors
... taking a QString for the executable. This weakens the very explicit QString -> FileName conversion via the named constructors for the special case of constructing a CommandLine. I think that's worthwhile here, as it reduces the noise on the caller site under circumstance where the nature of the thing is obvious. Change-Id: I27b4a73639728893d053b2e7ba65cb745f0ffe83 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -90,8 +90,7 @@ static FormatTask format(FormatTask task)
|
||||
options.replaceInStrings(QLatin1String("%file"), sourceFile.fileName());
|
||||
Utils::SynchronousProcess process;
|
||||
process.setTimeoutS(5);
|
||||
const CommandLine cmd(FilePath::fromString(executable), {options});
|
||||
Utils::SynchronousProcessResponse response = process.runBlocking(cmd);
|
||||
Utils::SynchronousProcessResponse response = process.runBlocking({executable, options});
|
||||
if (response.result != Utils::SynchronousProcessResponse::Finished) {
|
||||
task.error = QString(QT_TRANSLATE_NOOP("TextEditor", "Failed to format: %1."))
|
||||
.arg(response.exitMessage(executable, 5));
|
||||
|
||||
Reference in New Issue
Block a user