Skip to content

Commit

Permalink
Fix build on Debian 6
Browse files Browse the repository at this point in the history
  • Loading branch information
AlienCowEatCake committed Jun 28, 2020
1 parent 1c0443b commit dbc2cb3
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 35 deletions.
60 changes: 30 additions & 30 deletions src/QtUtils/src/Updater/Version.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2019 Peter S. Zhigalov <[email protected]>
Copyright (C) 2019-2020 Peter S. Zhigalov <[email protected]>
This file is part of the `QtUtils' library.
Expand Down Expand Up @@ -90,27 +90,27 @@ Version::Version(const QString &version, const QString &delimeter)
}

Version::Version(const Version &version)
: m_major(version.major())
, m_minor(version.minor())
, m_patch(version.patch())
, m_build(version.build())
: m_major(version.getMajor())
, m_minor(version.getMinor())
, m_patch(version.getPatch())
, m_build(version.getBuild())
{}

Version::~Version()
{}

Version &Version::operator = (const Version &other)
{
setMajor(other.major());
setMinor(other.minor());
setPatch(other.patch());
setBuild(other.build());
setMajor(other.getMajor());
setMinor(other.getMinor());
setPatch(other.getPatch());
setBuild(other.getBuild());
return *this;
}

bool Version::operator == (const Version &other) const
{
return major() == other.major() && minor() == other.minor() && patch() == other.patch() && build() == other.build();
return getMajor() == other.getMajor() && getMinor() == other.getMinor() && getPatch() == other.getPatch() && getBuild() == other.getBuild();
}

bool Version::operator != (const Version &other) const
Expand All @@ -120,24 +120,24 @@ bool Version::operator != (const Version &other) const

bool Version::operator < (const Version &other) const
{
if(major() < other.major())
if(getMajor() < other.getMajor())
return true;
if(major() > other.major())
if(getMajor() > other.getMajor())
return false;

if(minor() < other.minor())
if(getMinor() < other.getMinor())
return true;
if(minor() > other.minor())
if(getMinor() > other.getMinor())
return false;

if(patch() < other.patch())
if(getPatch() < other.getPatch())
return true;
if(patch() > other.patch())
if(getPatch() > other.getPatch())
return false;

if(build() < other.build())
if(getBuild() < other.getBuild())
return true;
if(build() > other.build())
if(getBuild() > other.getBuild())
return false;

return false;
Expand Down Expand Up @@ -165,40 +165,40 @@ bool Version::isValid() const

bool Version::hasMajor() const
{
return major() >= 0;
return getMajor() >= 0;
}

bool Version::hasMinor() const
{
return minor() >= 0;
return getMinor() >= 0;
}

bool Version::hasPatch() const
{
return patch() >= 0;
return getPatch() >= 0;
}

bool Version::hasBuild() const
{
return build() >= 0;
return getBuild() >= 0;
}

int Version::major() const
int Version::getMajor() const
{
return m_major;
}

int Version::minor() const
int Version::getMinor() const
{
return m_minor;
}

int Version::patch() const
int Version::getPatch() const
{
return m_patch;
}

int Version::build() const
int Version::getBuild() const
{
return m_build;
}
Expand Down Expand Up @@ -265,16 +265,16 @@ QString Version::string(int detail, const QString &delimeter) const
switch(detail)
{
case DetailBuild:
result.prepend(delimeter + QString::number(build()));
result.prepend(delimeter + QString::number(getBuild()));
Q_FALLTHROUGH();
case DetailPatch:
result.prepend(delimeter + QString::number(patch()));
result.prepend(delimeter + QString::number(getPatch()));
Q_FALLTHROUGH();
case DetailMinor:
result.prepend(delimeter + QString::number(minor()));
result.prepend(delimeter + QString::number(getMinor()));
Q_FALLTHROUGH();
case DetailMajor:
result.prepend(QString::number(major()));
result.prepend(QString::number(getMajor()));
Q_FALLTHROUGH();
default:
break;
Expand Down
10 changes: 5 additions & 5 deletions src/QtUtils/src/Updater/Version.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2019 Peter S. Zhigalov <[email protected]>
Copyright (C) 2019-2020 Peter S. Zhigalov <[email protected]>
This file is part of the `QtUtils' library.
Expand Down Expand Up @@ -56,10 +56,10 @@ class Version
bool hasPatch() const;
bool hasBuild() const;

int major() const;
int minor() const;
int patch() const;
int build() const;
int getMajor() const;
int getMinor() const;
int getPatch() const;
int getBuild() const;

void setMajor(int major);
void setMinor(int minor);
Expand Down

0 comments on commit dbc2cb3

Please sign in to comment.