Simplify IndexedVersionType::VersionType -> IndexedVersionType
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
@@ -74,33 +74,9 @@ struct DonationData {
|
||||
QString url;
|
||||
};
|
||||
|
||||
struct IndexedVersionType {
|
||||
enum class VersionType { Release = 1, Beta, Alpha, Unknown };
|
||||
IndexedVersionType(const QString& type);
|
||||
IndexedVersionType(const IndexedVersionType::VersionType& type);
|
||||
IndexedVersionType(const IndexedVersionType& type);
|
||||
IndexedVersionType() : IndexedVersionType(IndexedVersionType::VersionType::Unknown) {}
|
||||
static const QString toString(const IndexedVersionType::VersionType& type);
|
||||
static IndexedVersionType::VersionType enumFromString(const QString& type);
|
||||
bool isValid() const { return m_type != IndexedVersionType::VersionType::Unknown; }
|
||||
IndexedVersionType& operator=(const IndexedVersionType& other);
|
||||
bool operator==(const IndexedVersionType& other) const { return m_type == other.m_type; }
|
||||
bool operator==(const IndexedVersionType::VersionType& type) const { return m_type == type; }
|
||||
bool operator!=(const IndexedVersionType& other) const { return m_type != other.m_type; }
|
||||
bool operator!=(const IndexedVersionType::VersionType& type) const { return m_type != type; }
|
||||
bool operator<(const IndexedVersionType& other) const { return m_type < other.m_type; }
|
||||
bool operator<(const IndexedVersionType::VersionType& type) const { return m_type < type; }
|
||||
bool operator<=(const IndexedVersionType& other) const { return m_type <= other.m_type; }
|
||||
bool operator<=(const IndexedVersionType::VersionType& type) const { return m_type <= type; }
|
||||
bool operator>(const IndexedVersionType& other) const { return m_type > other.m_type; }
|
||||
bool operator>(const IndexedVersionType::VersionType& type) const { return m_type > type; }
|
||||
bool operator>=(const IndexedVersionType& other) const { return m_type >= other.m_type; }
|
||||
bool operator>=(const IndexedVersionType::VersionType& type) const { return m_type >= type; }
|
||||
|
||||
QString toString() const { return toString(m_type); }
|
||||
|
||||
IndexedVersionType::VersionType m_type;
|
||||
};
|
||||
enum class IndexedVersionType { Unknown, Release = 1, Beta, Alpha };
|
||||
IndexedVersionType indexedVersionTypeFromString(const QString& type);
|
||||
QString indexedVersionTypeToString(IndexedVersionType type);
|
||||
|
||||
struct Dependency {
|
||||
QVariant addonId;
|
||||
@@ -131,7 +107,7 @@ struct IndexedVersion {
|
||||
|
||||
QString getVersionDisplayString() const
|
||||
{
|
||||
auto release_type = version_type.isValid() ? QString(" [%1]").arg(version_type.toString()) : "";
|
||||
auto release_type = version_type != IndexedVersionType::Unknown ? QString(" [%1]").arg(indexedVersionTypeToString(version_type)) : "";
|
||||
auto versionStr = !version.contains(version_number) ? version_number : "";
|
||||
QString gameVersion = "";
|
||||
for (auto v : mcVersion) {
|
||||
|
||||
Reference in New Issue
Block a user