aboutsummaryrefslogtreecommitdiff
path: root/launcher/Version.h
diff options
context:
space:
mode:
authorAlexandru Ionut Tripon <alexandru.tripon97@gmail.com>2023-08-12 12:42:30 +0300
committerGitHub <noreply@github.com>2023-08-12 12:42:30 +0300
commitb3b2e9df35222209b4920202d86091eeeb87f03f (patch)
treece44c3877ee36c21279d142b2af1c393e7b87780 /launcher/Version.h
parentca061080c13042642fb3bd49a29a863756f45866 (diff)
parent3aba7f8fec45c7c87be486d8f6b5c96f69facf93 (diff)
downloadPrismLauncher-b3b2e9df35222209b4920202d86091eeeb87f03f.tar.gz
PrismLauncher-b3b2e9df35222209b4920202d86091eeeb87f03f.tar.bz2
PrismLauncher-b3b2e9df35222209b4920202d86091eeeb87f03f.zip
Merge branch 'develop' into feat/acknowledge_release_type
Signed-off-by: Alexandru Ionut Tripon <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/Version.h')
-rw-r--r--launcher/Version.h34
1 files changed, 19 insertions, 15 deletions
diff --git a/launcher/Version.h b/launcher/Version.h
index 659f8e54..101a907c 100644
--- a/launcher/Version.h
+++ b/launcher/Version.h
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-only
/*
- * PolyMC - Minecraft Launcher
+ * Prism Launcher - Minecraft Launcher
* Copyright (C) 2023 flowln <flowlnlnln@gmail.com>
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
*
@@ -48,12 +48,12 @@ class Version {
Version(QString str);
Version() = default;
- bool operator<(const Version &other) const;
- bool operator<=(const Version &other) const;
- bool operator>(const Version &other) const;
- bool operator>=(const Version &other) const;
- bool operator==(const Version &other) const;
- bool operator!=(const Version &other) const;
+ bool operator<(const Version& other) const;
+ bool operator<=(const Version& other) const;
+ bool operator>(const Version& other) const;
+ bool operator>=(const Version& other) const;
+ bool operator==(const Version& other) const;
+ bool operator!=(const Version& other) const;
QString toString() const { return m_string; }
@@ -72,7 +72,7 @@ class Version {
}
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
- auto numPart = QStringView{m_fullString}.left(cutoff);
+ auto numPart = QStringView{ m_fullString }.left(cutoff);
#else
auto numPart = m_fullString.leftRef(cutoff);
#endif
@@ -83,7 +83,7 @@ class Version {
}
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
- auto stringPart = QStringView{m_fullString}.mid(cutoff);
+ auto stringPart = QStringView{ m_fullString }.mid(cutoff);
#else
auto stringPart = m_fullString.midRef(cutoff);
#endif
@@ -103,8 +103,14 @@ class Version {
QString m_fullString;
- [[nodiscard]] inline bool isAppendix() const { return m_stringPart.startsWith('+'); }
- [[nodiscard]] inline bool isPreRelease() const { return m_stringPart.startsWith('-') && m_stringPart.length() > 1; }
+ [[nodiscard]] inline bool isAppendix() const
+ {
+ return m_stringPart.startsWith('+');
+ }
+ [[nodiscard]] inline bool isPreRelease() const
+ {
+ return m_stringPart.startsWith('-') && m_stringPart.length() > 1;
+ }
inline bool operator==(const Section& other) const
{
@@ -121,7 +127,7 @@ class Version {
}
inline bool operator<(const Section& other) const
- {
+ {
static auto unequal_is_less = [](Section const& non_null) -> bool {
if (non_null.m_stringPart.isEmpty())
return non_null.m_numPart == 0;
@@ -154,7 +160,7 @@ class Version {
{
return !(*this == other);
}
- inline bool operator>(const Section &other) const
+ inline bool operator>(const Section& other) const
{
return !(*this < other || *this == other);
}
@@ -166,5 +172,3 @@ class Version {
void parse();
};
-
-