chore(clang-tidy): modernize the code

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2026-05-11 23:16:39 +03:00
parent 18f04b1e29
commit 9c88eb9bc0
No known key found for this signature in database
GPG key ID: 55EF5DA53DB36318
36 changed files with 713 additions and 632 deletions

View file

@ -62,7 +62,7 @@ void ModrinthCheckUpdate::executeTask()
// Sadly the API can only handle one hash type per call, se we
// need to generate a new hash if the current one is innadequate
// (though it will rarely happen, if at all)
if (resource->metadata()->hash_format != m_hashType) {
if (resource->metadata()->hashFormat != m_hashType) {
auto hashTask = Hashing::createHasher(resource->fileinfo().absoluteFilePath(), ModPlatform::ResourceProvider::MODRINTH);
connect(hashTask.get(), &Hashing::Hasher::resultsReady,
[this, resource](const QString& hash) { m_mappings.insert(hash, resource); });
@ -176,12 +176,12 @@ void ModrinthCheckUpdate::checkVersionsResponse(QByteArray* response, std::optio
auto pack = std::make_shared<ModPlatform::IndexedPack>();
pack->name = resource->name();
pack->slug = resource->metadata()->slug;
pack->addonId = resource->metadata()->project_id;
pack->addonId = resource->metadata()->projectId;
pack->provider = ModPlatform::ResourceProvider::MODRINTH;
if ((projectVer.hash != hash && projectVer.is_preferred) || (resource->status() == ResourceStatus::NotInstalled)) {
auto downloadTask = makeShared<ResourceDownloadTask>(pack, projectVer, m_resourceModel, true, "update");
QString oldVersion = resource->metadata()->version_number;
QString oldVersion = resource->metadata()->versionNumber;
if (oldVersion.isEmpty()) {
if (resource->status() == ResourceStatus::NotInstalled) {
oldVersion = tr("Not installed");