Utils: Add convenience function for generating a unique Id

Change-Id: I74516ef5077009ebcf1d47c724ca63e502729ede
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2024-07-12 11:32:14 +02:00
parent 6d4e901e5e
commit fec896e712
20 changed files with 25 additions and 36 deletions

View File

@@ -5,8 +5,6 @@
#include <utils/qtcprocess.h>
#include <QUuid>
namespace MesonProjectManager {
namespace Internal {
@@ -14,7 +12,7 @@ ToolWrapper::ToolWrapper(const QString &name, const Utils::FilePath &path, bool
: m_version(read_version(path))
, m_isValid{path.exists() && m_version.isValid}
, m_autoDetected{autoDetected}
, m_id{Utils::Id::fromString(QUuid::createUuid().toString())}
, m_id{Utils::Id::generate()}
, m_exe{path}
, m_name{name}
{}
@@ -30,7 +28,7 @@ ToolWrapper::ToolWrapper(const QString &name,
, m_exe{path}
, m_name{name}
{
QTC_ASSERT(m_id.isValid(), m_id = Utils::Id::fromString(QUuid::createUuid().toString()));
QTC_ASSERT(m_id.isValid(), m_id = Utils::Id::generate());
}
void ToolWrapper::setExe(const Utils::FilePath &newExe)