mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 13:36:48 +08:00
Ref T419, use version from IDatastoreObject in CArtifact
* add QVersion * remove version parts from CArtifact
This commit is contained in:
committed by
Mat Sutcliffe
parent
aabc975889
commit
b9c233802f
@@ -25,10 +25,11 @@ namespace BlackMisc
|
||||
CArtifact::CArtifact(
|
||||
const QString &name, const QString &version, const QString &md5,
|
||||
CArtifact::ArtifactType type, int size, bool existing, const CPlatform &platform):
|
||||
m_name(name.trimmed()), m_version(trimVersionString(version)),
|
||||
m_name(name.trimmed()),
|
||||
m_md5(md5), m_type(static_cast<int>(type)), m_size(size), m_existing(existing),
|
||||
m_platform(platform)
|
||||
{
|
||||
this->setVersion(trimVersionString(version));
|
||||
if (!name.isEmpty() && version.isEmpty())
|
||||
{
|
||||
m_version = versionNumberFromFilename(name);
|
||||
@@ -84,15 +85,10 @@ namespace BlackMisc
|
||||
return rf;
|
||||
}
|
||||
|
||||
QVersionNumber CArtifact::getQVersion() const
|
||||
{
|
||||
return QVersionNumber::fromString(getVersionString());
|
||||
}
|
||||
|
||||
bool CArtifact::isNewerThanCurrentBuild() const
|
||||
{
|
||||
if (this->isUnknown()) { return false; }
|
||||
if (this->getVersionString().isEmpty()) { return false; }
|
||||
if (!this->hasVersion()) { return false; }
|
||||
return this->getQVersion() > CBuildConfig::getVersion();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user