From 19205e10af06c119d791ba9adde6a5322de4b8b7 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 3 Nov 2021 15:27:04 +0100 Subject: [PATCH] Use QtcProcess in NimToolChain Change-Id: If45fe607cb17387692f9350166d1382090a9a50a Reviewed-by: hjk --- src/plugins/nim/project/nimtoolchain.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/nim/project/nimtoolchain.cpp b/src/plugins/nim/project/nimtoolchain.cpp index bfa4798eb85..d68654ade33 100644 --- a/src/plugins/nim/project/nimtoolchain.cpp +++ b/src/plugins/nim/project/nimtoolchain.cpp @@ -29,9 +29,9 @@ #include #include +#include #include -#include #include using namespace ProjectExplorer; @@ -116,11 +116,12 @@ bool NimToolChain::fromMap(const QVariantMap &data) bool NimToolChain::parseVersion(const FilePath &path, std::tuple &result) { - QProcess process; - process.start(path.toString(), {"--version"}); + QtcProcess process; + process.setCommand({path, {"--version"}}); + process.start(); if (!process.waitForFinished()) return false; - const QString version = QString::fromUtf8(process.readLine()); + const QString version = QString::fromUtf8(process.readAllStandardOutput()).section('\n', 0, 0); if (version.isEmpty()) return false; const QRegularExpression regex("(\\d+)\\.(\\d+)\\.(\\d+)");