forked from qt-creator/qt-creator
Use QtcProcess for reading version number in meson project
Change-Id: I8f7b72ae9d21fec5a7c8e9baf154dcba70a3a2b3 Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io> Reviewed-by: Alexis Jeandet <alexis.jeandet@member.fsf.org> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -25,6 +25,8 @@
|
||||
|
||||
#include "toolwrapper.h"
|
||||
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
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 {};
|
||||
}
|
||||
|
@@ -34,7 +34,6 @@
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QProcess>
|
||||
#include <QUuid>
|
||||
#include <QVariant>
|
||||
#include <QVariantMap>
|
||||
|
Reference in New Issue
Block a user