diff options
author | timoreo <contact@timoreo.fr> | 2022-09-26 11:50:31 +0200 |
---|---|---|
committer | timoreo <contact@timoreo.fr> | 2022-09-26 11:50:31 +0200 |
commit | 9ff364b0d3c12f9138037cce585c03c850721b82 (patch) | |
tree | 3404fb8ba162275b8eac6678c12832c3ec2a0936 /launcher/modplatform/modrinth/ModrinthInstanceCreationTask.cpp | |
parent | 4f6d964217f6addd4f29969168a7d40ed4729dde (diff) | |
download | PrismLauncher-9ff364b0d3c12f9138037cce585c03c850721b82.tar.gz PrismLauncher-9ff364b0d3c12f9138037cce585c03c850721b82.tar.bz2 PrismLauncher-9ff364b0d3c12f9138037cce585c03c850721b82.zip |
huge nit: added const refs, everywhere
Signed-off-by: timoreo <contact@timoreo.fr>
Diffstat (limited to 'launcher/modplatform/modrinth/ModrinthInstanceCreationTask.cpp')
-rw-r--r-- | launcher/modplatform/modrinth/ModrinthInstanceCreationTask.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/launcher/modplatform/modrinth/ModrinthInstanceCreationTask.cpp b/launcher/modplatform/modrinth/ModrinthInstanceCreationTask.cpp index 2cb6e786..f9709551 100644 --- a/launcher/modplatform/modrinth/ModrinthInstanceCreationTask.cpp +++ b/launcher/modplatform/modrinth/ModrinthInstanceCreationTask.cpp @@ -121,7 +121,7 @@ bool ModrinthCreationTask::updateInstance() // TODO: Currently 'overrides' will always override the stuff on update. How do we preserve unchanged overrides? // FIXME: We may want to do something about disabled mods. auto old_overrides = Override::readOverrides("overrides", old_index_folder); - for (auto entry : old_overrides) { + for (const auto& entry : old_overrides) { if (entry.isEmpty()) continue; qDebug() << "Scheduling" << entry << "for removal"; @@ -129,7 +129,7 @@ bool ModrinthCreationTask::updateInstance() } auto old_client_overrides = Override::readOverrides("client-overrides", old_index_folder); - for (auto entry : old_overrides) { + for (const auto& entry : old_overrides) { if (entry.isEmpty()) continue; qDebug() << "Scheduling" << entry << "for removal"; @@ -235,7 +235,7 @@ bool ModrinthCreationTask::createInstance() dl->addValidator(new Net::ChecksumValidator(file.hashAlgorithm, file.hash)); m_files_job->addNetAction(dl); - if (file.downloads.size() > 0) { + if (!file.downloads.empty()) { // FIXME: This really needs to be put into a ConcurrentTask of // MultipleOptionsTask's , once those exist :) connect(dl.get(), &NetAction::failed, [this, &file, path, dl] { @@ -281,7 +281,7 @@ bool ModrinthCreationTask::createInstance() return ended_well; } -bool ModrinthCreationTask::parseManifest(QString index_path, std::vector<Modrinth::File>& files, bool set_managed_info, bool show_optional_dialog) +bool ModrinthCreationTask::parseManifest(const QString& index_path, std::vector<Modrinth::File>& files, bool set_managed_info, bool show_optional_dialog) { try { auto doc = Json::requireDocument(index_path); @@ -300,7 +300,7 @@ bool ModrinthCreationTask::parseManifest(QString index_path, std::vector<Modrint auto jsonFiles = Json::requireIsArrayOf<QJsonObject>(obj, "files", "modrinth.index.json"); bool had_optional = false; - for (auto modInfo : jsonFiles) { + for (const auto& modInfo : jsonFiles) { Modrinth::File file; file.path = Json::requireString(modInfo, "path"); |