diff options
Diffstat (limited to 'launcher/modplatform/modrinth')
-rw-r--r-- | launcher/modplatform/modrinth/ModrinthPackExportTask.cpp | 12 | ||||
-rw-r--r-- | launcher/modplatform/modrinth/ModrinthPackIndex.cpp | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp b/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp index 4cd88aa6..d08759cf 100644 --- a/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp +++ b/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp @@ -180,10 +180,10 @@ void ModrinthPackExportTask::parseApiResponse(const std::shared_ptr<QByteArray> if (obj.isEmpty()) continue; - const QJsonArray files = obj["files"].toArray(); - if (auto fileIter = std::find_if(files.begin(), files.end(), + const QJsonArray files_array = obj["files"].toArray(); + if (auto fileIter = std::find_if(files_array.begin(), files_array.end(), [&iterator](const QJsonValue& file) { return file["hashes"]["sha512"] == iterator.value(); }); - fileIter != files.end()) { + fileIter != files_array.end()) { // map the file to the url resolvedFiles[iterator.key()] = ResolvedFile{ fileIter->toObject()["hashes"].toObject()["sha1"].toString(), iterator.value(), @@ -293,7 +293,7 @@ QByteArray ModrinthPackExportTask::generateIndex() obj["dependencies"] = dependencies; } - QJsonArray files; + QJsonArray files_array; QMapIterator<QString, ResolvedFile> iterator(resolvedFiles); while (iterator.hasNext()) { iterator.next(); @@ -311,9 +311,9 @@ QByteArray ModrinthPackExportTask::generateIndex() file["hashes"] = hashes; file["fileSize"] = value.size; - files << file; + files_array << file; } - obj["files"] = files; + obj["files"] = files_array; return QJsonDocument(obj).toJson(QJsonDocument::Compact); } diff --git a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp index b4037349..969018a9 100644 --- a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp +++ b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp @@ -95,7 +95,7 @@ void Modrinth::loadExtraPackData(ModPlatform::IndexedPack& pack, QJsonObject& ob void Modrinth::loadIndexedPackVersions(ModPlatform::IndexedPack& pack, QJsonArray& arr, - const shared_qobject_ptr<QNetworkAccessManager>& network, + [[maybe_unused]] const shared_qobject_ptr<QNetworkAccessManager>& network, const BaseInstance* inst) { QVector<ModPlatform::IndexedVersion> unsortedVersions; @@ -218,7 +218,7 @@ auto Modrinth::loadIndexedPackVersion(QJsonObject& obj, QString preferred_hash_t return {}; } -auto Modrinth::loadDependencyVersions(const ModPlatform::Dependency& m, QJsonArray& arr) -> ModPlatform::IndexedVersion +auto Modrinth::loadDependencyVersions([[maybe_unused]] const ModPlatform::Dependency& m, QJsonArray& arr) -> ModPlatform::IndexedVersion { QVector<ModPlatform::IndexedVersion> versions; @@ -235,4 +235,4 @@ auto Modrinth::loadDependencyVersions(const ModPlatform::Dependency& m, QJsonArr }; std::sort(versions.begin(), versions.end(), orderSortPredicate); return versions.length() != 0 ? versions.front() : ModPlatform::IndexedVersion(); -}
\ No newline at end of file +} |