From 832a61f88674ee1ba01d7618e1021184cc851e3a Mon Sep 17 00:00:00 2001 From: Rachel Powers <508861+Ryex@users.noreply.github.com> Date: Fri, 26 May 2023 16:34:30 -0700 Subject: [PATCH] fix: make codeQl happy Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> --- launcher/modplatform/ModIndex.cpp | 8 +++++++- launcher/modplatform/ModIndex.h | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/launcher/modplatform/ModIndex.cpp b/launcher/modplatform/ModIndex.cpp index 607c26e61..3e1f473e9 100644 --- a/launcher/modplatform/ModIndex.cpp +++ b/launcher/modplatform/ModIndex.cpp @@ -60,6 +60,12 @@ IndexedVersionType::IndexedVersionType(const IndexedVersionType& other) m_type = other.m_type; } +IndexedVersionType& IndexedVersionType::operator=(const IndexedVersionType& other) +{ + m_type = other.m_type; + return *this; +} + const QString IndexedVersionType::toString (const IndexedVersionType::Enum& type) { switch (type) { @@ -76,7 +82,7 @@ const QString IndexedVersionType::toString (const IndexedVersionType::Enum& type } } -const IndexedVersionType::Enum IndexedVersionType::enumFromString(const QString& type) +IndexedVersionType::Enum IndexedVersionType::enumFromString(const QString& type) { auto found = s_indexed_version_type_names.constFind(type); if (found != s_indexed_version_type_names.constEnd()) { diff --git a/launcher/modplatform/ModIndex.h b/launcher/modplatform/ModIndex.h index 10b61b167..f317d29e8 100644 --- a/launcher/modplatform/ModIndex.h +++ b/launcher/modplatform/ModIndex.h @@ -65,8 +65,9 @@ struct IndexedVersionType { IndexedVersionType(const IndexedVersionType& type); IndexedVersionType() : IndexedVersionType(IndexedVersionType::Enum::UNKNOWN) {} static const QString toString (const IndexedVersionType::Enum& type); - static const IndexedVersionType::Enum enumFromString(const QString& type); + static IndexedVersionType::Enum enumFromString(const QString& type); bool isValid() const {return m_type != IndexedVersionType::Enum::UNKNOWN; } + IndexedVersionType& operator=(const IndexedVersionType& other); bool operator==(const IndexedVersionType& other) const { return m_type == other.m_type; } bool operator==(const IndexedVersionType::Enum& type) const { return m_type == type; } bool operator<(const IndexedVersionType& other) const { return m_type < other.m_type; }