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 "toolwrapper.h"
|
||||||
|
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
namespace MesonProjectManager {
|
namespace MesonProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -60,11 +62,11 @@ void ToolWrapper::setExe(const Utils::FilePath &newExe)
|
|||||||
Version ToolWrapper::read_version(const Utils::FilePath &toolPath)
|
Version ToolWrapper::read_version(const Utils::FilePath &toolPath)
|
||||||
{
|
{
|
||||||
if (toolPath.toFileInfo().isExecutable()) {
|
if (toolPath.toFileInfo().isExecutable()) {
|
||||||
QProcess process;
|
Utils::QtcProcess process;
|
||||||
process.start(toolPath.toString(), {"--version"});
|
process.setCommand({ toolPath, { "--version" } });
|
||||||
if (process.waitForFinished()) {
|
process.start();
|
||||||
return Version::fromString(QString::fromUtf8(process.readLine()));
|
if (process.waitForFinished())
|
||||||
}
|
return Version::fromString(process.stdOut());
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
@@ -34,7 +34,6 @@
|
|||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QProcess>
|
|
||||||
#include <QUuid>
|
#include <QUuid>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
|
Reference in New Issue
Block a user