diff --git a/src/plugins/mesonprojectmanager/exewrappers/toolwrapper.cpp b/src/plugins/mesonprojectmanager/exewrappers/toolwrapper.cpp index 2e2ad082874..d13175f5f4f 100644 --- a/src/plugins/mesonprojectmanager/exewrappers/toolwrapper.cpp +++ b/src/plugins/mesonprojectmanager/exewrappers/toolwrapper.cpp @@ -25,6 +25,8 @@ #include "toolwrapper.h" +#include + namespace MesonProjectManager { namespace Internal { @@ -60,11 +62,11 @@ void ToolWrapper::setExe(const Utils::FilePath &newExe) Version ToolWrapper::read_version(const Utils::FilePath &toolPath) { if (toolPath.toFileInfo().isExecutable()) { - QProcess process; - process.start(toolPath.toString(), {"--version"}); - if (process.waitForFinished()) { - return Version::fromString(QString::fromUtf8(process.readLine())); - } + Utils::QtcProcess process; + process.setCommand({ toolPath, { "--version" } }); + process.start(); + if (process.waitForFinished()) + return Version::fromString(process.stdOut()); } return {}; } diff --git a/src/plugins/mesonprojectmanager/exewrappers/toolwrapper.h b/src/plugins/mesonprojectmanager/exewrappers/toolwrapper.h index a2000677453..68ea6d4fdea 100644 --- a/src/plugins/mesonprojectmanager/exewrappers/toolwrapper.h +++ b/src/plugins/mesonprojectmanager/exewrappers/toolwrapper.h @@ -34,7 +34,6 @@ #include #include -#include #include #include #include