chore(clang-tidy): fix clang tidy warnings

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2026-05-08 23:38:49 +03:00
parent 50216e7856
commit cbe143c266
No known key found for this signature in database
GPG key ID: 55EF5DA53DB36318
14 changed files with 115 additions and 110 deletions

View file

@ -262,7 +262,7 @@ void ModrinthCreationTask::createInstance()
ModDetails d;
d.mod_id = filePath;
mod->setDetails(d);
m_resources[file.hash.toHex()] = mod;
m_resources.insert(file.hash.toHex(), mod);
}
if (file.downloads.empty()) {
emitFailed(tr("The file '%1' is missing a download link. This is invalid in the pack format.").arg(fileName));
@ -324,9 +324,9 @@ bool ModrinthCreationTask::parseManifest(const QString& indexPath, std::vector<F
if (setInternalData) {
if (m_managedVersionId.isEmpty()) {
m_managedVersionId = obj["versionId"].toString();
m_managedVersionId = obj.value("versionId").toString();
}
m_managedName = obj["name"].toString();
m_managedName = obj.value("name").toString();
}
auto jsonFiles = Json::requireIsArrayOf<QJsonObject>(obj, "files", "modrinth.index.json");
@ -436,7 +436,7 @@ bool ModrinthCreationTask::parseManifest(const QString& indexPath, std::vector<F
void ModrinthCreationTask::ensureMetaLoop()
{
QDir folder = FS::PathCombine(m_stagingPath, "minecraft", "jarmods");
QDir const folder = FS::PathCombine(m_stagingPath, "minecraft", "jarmods");
auto ensureMetadataTask = makeShared<EnsureMetadataTask>(m_resources, folder, ModPlatform::ResourceProvider::MODRINTH);
connect(ensureMetadataTask.get(), &Task::succeeded, this, &ModrinthCreationTask::finishInstall);
connect(ensureMetadataTask.get(), &Task::failed, this, &ModrinthCreationTask::emitFailed);
@ -474,7 +474,7 @@ void ModrinthCreationTask::finishInstall()
// Update information of the already installed instance, if any.
if (m_oldInstance) {
setAbortable(false);
auto* inst = m_oldInstance.value();
auto* inst = *m_oldInstance;
// Only change the name if it didn't use a custom name, so that the previous custom name
// is preserved, but if we're using the original one, we update the version string.
@ -485,7 +485,7 @@ void ModrinthCreationTask::finishInstall()
}
}
setManagedPack(m_oldInstance.value());
setManagedPack(*m_oldInstance);
}
if (shouldOverride()) {