diff options
author | flow <flowlnlnln@gmail.com> | 2022-08-13 14:35:44 -0300 |
---|---|---|
committer | flow <flowlnlnln@gmail.com> | 2022-08-20 10:49:56 -0300 |
commit | 0b81b283bfdd16b409127f22eac7b51ce0142929 (patch) | |
tree | 443a13c3420912d9961408136f616b5d681e9b24 /launcher/minecraft | |
parent | e2ab2aea32b6d48ee0c9f90442ed53c47e2e7d96 (diff) | |
download | PrismLauncher-0b81b283bfdd16b409127f22eac7b51ce0142929.tar.gz PrismLauncher-0b81b283bfdd16b409127f22eac7b51ce0142929.tar.bz2 PrismLauncher-0b81b283bfdd16b409127f22eac7b51ce0142929.zip |
fix: LGTM warnings
Signed-off-by: flow <flowlnlnln@gmail.com>
Diffstat (limited to 'launcher/minecraft')
-rw-r--r-- | launcher/minecraft/mod/ModDetails.h | 28 | ||||
-rw-r--r-- | launcher/minecraft/mod/ResourceFolderModel.cpp | 4 |
2 files changed, 30 insertions, 2 deletions
diff --git a/launcher/minecraft/mod/ModDetails.h b/launcher/minecraft/mod/ModDetails.h index 118b156f..dd84b0a3 100644 --- a/launcher/minecraft/mod/ModDetails.h +++ b/launcher/minecraft/mod/ModDetails.h @@ -91,4 +91,32 @@ struct ModDetails , authors(other.authors) , status(other.status) {} + + ModDetails& operator=(ModDetails& other) + { + this->mod_id = other.mod_id; + this->name = other.name; + this->version = other.version; + this->mcversion = other.mcversion; + this->homeurl = other.homeurl; + this->description = other.description; + this->authors = other.authors; + this->status = other.status; + + return *this; + } + + ModDetails& operator=(ModDetails&& other) + { + this->mod_id = other.mod_id; + this->name = other.name; + this->version = other.version; + this->mcversion = other.mcversion; + this->homeurl = other.homeurl; + this->description = other.description; + this->authors = other.authors; + this->status = other.status; + + return *this; + } }; diff --git a/launcher/minecraft/mod/ResourceFolderModel.cpp b/launcher/minecraft/mod/ResourceFolderModel.cpp index 31d88eb6..bc18ddc2 100644 --- a/launcher/minecraft/mod/ResourceFolderModel.cpp +++ b/launcher/minecraft/mod/ResourceFolderModel.cpp @@ -380,8 +380,8 @@ bool ResourceFolderModel::validateIndex(const QModelIndex& index) const if (!index.isValid()) return false; - size_t row = index.row(); - if (row < 0 || row >= size()) + int row = index.row(); + if (row < 0 || row >= m_resources.size()) return false; return true; |