summaryrefslogtreecommitdiffstats
path: root/depends/util/src/modutils.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-01-27 22:31:07 +0100
committerPetr Mrázek <peterix@gmail.com>2015-04-02 00:14:06 +0200
commit791221e923586bb717396ecf18bd13e57034df99 (patch)
tree9f608af07375b38626c8964671620477158341ba /depends/util/src/modutils.cpp
parent593111b14463e9d5d08256061b981b5ab1cfb710 (diff)
downloadMultiMC-791221e923586bb717396ecf18bd13e57034df99.tar
MultiMC-791221e923586bb717396ecf18bd13e57034df99.tar.gz
MultiMC-791221e923586bb717396ecf18bd13e57034df99.tar.lz
MultiMC-791221e923586bb717396ecf18bd13e57034df99.tar.xz
MultiMC-791221e923586bb717396ecf18bd13e57034df99.zip
NOISSUE Refactors and moving of things
Diffstat (limited to 'depends/util/src/modutils.cpp')
-rw-r--r--depends/util/src/modutils.cpp23
1 files changed, 7 insertions, 16 deletions
diff --git a/depends/util/src/modutils.cpp b/depends/util/src/modutils.cpp
index 67c09dec..5f89eacd 100644
--- a/depends/util/src/modutils.cpp
+++ b/depends/util/src/modutils.cpp
@@ -15,9 +15,9 @@ bool Util::Version::operator<(const Version &other) const
const int size = qMax(m_sections.size(), other.m_sections.size());
for (int i = 0; i < size; ++i)
{
- const Section sec1 = (i >= m_sections.size()) ? Section("0", 0) : m_sections.at(i);
+ const Section sec1 = (i >= m_sections.size()) ? Section("0") : m_sections.at(i);
const Section sec2 =
- (i >= other.m_sections.size()) ? Section("0", 0) : other.m_sections.at(i);
+ (i >= other.m_sections.size()) ? Section("0") : other.m_sections.at(i);
if (sec1 != sec2)
{
return sec1 < sec2;
@@ -35,9 +35,9 @@ bool Util::Version::operator>(const Version &other) const
const int size = qMax(m_sections.size(), other.m_sections.size());
for (int i = 0; i < size; ++i)
{
- const Section sec1 = (i >= m_sections.size()) ? Section("0", 0) : m_sections.at(i);
+ const Section sec1 = (i >= m_sections.size()) ? Section("0") : m_sections.at(i);
const Section sec2 =
- (i >= other.m_sections.size()) ? Section("0", 0) : other.m_sections.at(i);
+ (i >= other.m_sections.size()) ? Section("0") : other.m_sections.at(i);
if (sec1 != sec2)
{
return sec1 > sec2;
@@ -55,9 +55,9 @@ bool Util::Version::operator==(const Version &other) const
const int size = qMax(m_sections.size(), other.m_sections.size());
for (int i = 0; i < size; ++i)
{
- const Section sec1 = (i >= m_sections.size()) ? Section("0", 0) : m_sections.at(i);
+ const Section sec1 = (i >= m_sections.size()) ? Section("0") : m_sections.at(i);
const Section sec2 =
- (i >= other.m_sections.size()) ? Section("0", 0) : other.m_sections.at(i);
+ (i >= other.m_sections.size()) ? Section("0") : other.m_sections.at(i);
if (sec1 != sec2)
{
return false;
@@ -79,16 +79,7 @@ void Util::Version::parse()
for (const auto part : parts)
{
- bool ok = false;
- int num = part.toInt(&ok);
- if (ok)
- {
- m_sections.append(Section(part, num));
- }
- else
- {
- m_sections.append(Section(part));
- }
+ m_sections.append(Section(part));
}
}